
(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 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z) :precision binary64 (fabs (- (/ (+ x 4.0) y) (* (/ x y) z))))
double code(double x, double y, double z) {
return fabs((((x + 4.0) / y) - ((x / y) * z)));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = abs((((x + 4.0d0) / y) - ((x / y) * z)))
end function
public static double code(double x, double y, double z) {
return Math.abs((((x + 4.0) / y) - ((x / y) * z)));
}
def code(x, y, z): return math.fabs((((x + 4.0) / y) - ((x / y) * z)))
function code(x, y, z) return abs(Float64(Float64(Float64(x + 4.0) / y) - Float64(Float64(x / y) * z))) end
function tmp = code(x, y, z) tmp = abs((((x + 4.0) / y) - ((x / y) * z))); end
code[x_, y_, z_] := N[Abs[N[(N[(N[(x + 4.0), $MachinePrecision] / y), $MachinePrecision] - N[(N[(x / y), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|\frac{x + 4}{y} - \frac{x}{y} \cdot z\right|
\end{array}
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (<= y_m 2e-52) (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 <= 2e-52) {
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 <= 2e-52) 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, 2e-52], 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 2 \cdot 10^{-52}:\\
\;\;\;\;\left|\frac{-1}{y\_m} \cdot \mathsf{fma}\left(x, z, -4 - x\right)\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\mathsf{fma}\left(x, \frac{z}{y\_m}, \frac{-4 - x}{y\_m}\right)\right|\\
\end{array}
\end{array}
if y < 2e-52Initial program 89.7%
Simplified98.3%
if 2e-52 < y Initial program 95.9%
fabs-sub95.9%
associate-*l/93.1%
associate-*r/99.9%
fmm-def99.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 (if (<= y_m 1.42e-52) (fabs (* (/ -1.0 y_m) (fma x z (- -4.0 x)))) (fabs (- (/ (+ x 4.0) y_m) (/ x (/ y_m z))))))
y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if (y_m <= 1.42e-52) {
tmp = fabs(((-1.0 / y_m) * fma(x, z, (-4.0 - x))));
} else {
tmp = fabs((((x + 4.0) / y_m) - (x / (y_m / z))));
}
return tmp;
}
y_m = abs(y) function code(x, y_m, z) tmp = 0.0 if (y_m <= 1.42e-52) tmp = abs(Float64(Float64(-1.0 / y_m) * fma(x, z, Float64(-4.0 - x)))); else tmp = abs(Float64(Float64(Float64(x + 4.0) / y_m) - Float64(x / Float64(y_m / z)))); end return tmp end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_] := If[LessEqual[y$95$m, 1.42e-52], N[Abs[N[(N[(-1.0 / y$95$m), $MachinePrecision] * N[(x * z + N[(-4.0 - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[(N[(x + 4.0), $MachinePrecision] / y$95$m), $MachinePrecision] - N[(x / N[(y$95$m / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;y\_m \leq 1.42 \cdot 10^{-52}:\\
\;\;\;\;\left|\frac{-1}{y\_m} \cdot \mathsf{fma}\left(x, z, -4 - x\right)\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{x + 4}{y\_m} - \frac{x}{\frac{y\_m}{z}}\right|\\
\end{array}
\end{array}
if y < 1.4200000000000001e-52Initial program 89.7%
Simplified98.3%
if 1.4200000000000001e-52 < y Initial program 95.9%
associate-*l/93.1%
associate-*r/99.9%
clear-num99.9%
un-div-inv99.9%
Applied egg-rr99.9%
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))) INFINITY)
(fabs (- t_0 (/ z (/ y_m x))))
t_0)))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))) <= ((double) INFINITY)) {
tmp = fabs((t_0 - (z / (y_m / x))));
} else {
tmp = t_0;
}
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 tmp;
if ((t_0 - (z * (x / y_m))) <= Double.POSITIVE_INFINITY) {
tmp = Math.abs((t_0 - (z / (y_m / x))));
} else {
tmp = t_0;
}
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))) <= math.inf: tmp = math.fabs((t_0 - (z / (y_m / x)))) else: tmp = t_0 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))) <= Inf) tmp = abs(Float64(t_0 - Float64(z / Float64(y_m / x)))); else tmp = t_0; 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))) <= Inf) tmp = abs((t_0 - (z / (y_m / x)))); 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[(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], Infinity], N[Abs[N[(t$95$0 - N[(z / N[(y$95$m / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], t$95$0]]
\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 \infty:\\
\;\;\;\;\left|t\_0 - \frac{z}{\frac{y\_m}{x}}\right|\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if (-.f64 (/.f64 (+.f64 x #s(literal 4 binary64)) y) (*.f64 (/.f64 x y) z)) < +inf.0Initial program 98.7%
*-commutative98.7%
clear-num98.7%
un-div-inv98.7%
Applied egg-rr98.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/21.1%
associate-*r/21.1%
fmm-def52.6%
distribute-neg-frac52.6%
+-commutative52.6%
distribute-neg-in52.6%
unsub-neg52.6%
metadata-eval52.6%
Simplified52.6%
fma-undefine21.1%
associate-*r/21.1%
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%
fabs-sub0.0%
add-sqr-sqrt0.0%
fabs-sqr0.0%
add-sqr-sqrt0.0%
associate-*l/5.3%
sub-div63.2%
Applied egg-rr63.2%
Taylor expanded in z around 0 31.6%
Final simplification93.8%
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)) t_0)))
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 = t_0;
}
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 = t_0;
}
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 = t_0 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 = t_0; 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 = t_0; 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], t$95$0]]]
\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}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if (-.f64 (/.f64 (+.f64 x #s(literal 4 binary64)) y) (*.f64 (/.f64 x y) z)) < +inf.0Initial program 98.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/21.1%
associate-*r/21.1%
fmm-def52.6%
distribute-neg-frac52.6%
+-commutative52.6%
distribute-neg-in52.6%
unsub-neg52.6%
metadata-eval52.6%
Simplified52.6%
fma-undefine21.1%
associate-*r/21.1%
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%
fabs-sub0.0%
add-sqr-sqrt0.0%
fabs-sqr0.0%
add-sqr-sqrt0.0%
associate-*l/5.3%
sub-div63.2%
Applied egg-rr63.2%
Taylor expanded in z around 0 31.6%
Final simplification93.7%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (<= x -2.55e+36) (* x (/ (+ -1.0 z) y_m)) (if (<= x 2.7e+89) (/ (- (+ x 4.0) (* x z)) y_m) (/ x (/ y_m (+ z 1.0))))))
y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if (x <= -2.55e+36) {
tmp = x * ((-1.0 + z) / y_m);
} else if (x <= 2.7e+89) {
tmp = ((x + 4.0) - (x * z)) / y_m;
} else {
tmp = x / (y_m / (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 <= (-2.55d+36)) then
tmp = x * (((-1.0d0) + z) / y_m)
else if (x <= 2.7d+89) then
tmp = ((x + 4.0d0) - (x * z)) / y_m
else
tmp = x / (y_m / (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 <= -2.55e+36) {
tmp = x * ((-1.0 + z) / y_m);
} else if (x <= 2.7e+89) {
tmp = ((x + 4.0) - (x * z)) / y_m;
} else {
tmp = x / (y_m / (z + 1.0));
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): tmp = 0 if x <= -2.55e+36: tmp = x * ((-1.0 + z) / y_m) elif x <= 2.7e+89: tmp = ((x + 4.0) - (x * z)) / y_m else: tmp = x / (y_m / (z + 1.0)) return tmp
y_m = abs(y) function code(x, y_m, z) tmp = 0.0 if (x <= -2.55e+36) tmp = Float64(x * Float64(Float64(-1.0 + z) / y_m)); elseif (x <= 2.7e+89) tmp = Float64(Float64(Float64(x + 4.0) - Float64(x * z)) / y_m); else tmp = Float64(x / Float64(y_m / 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 <= -2.55e+36) tmp = x * ((-1.0 + z) / y_m); elseif (x <= 2.7e+89) tmp = ((x + 4.0) - (x * z)) / y_m; else tmp = x / (y_m / (z + 1.0)); end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_] := If[LessEqual[x, -2.55e+36], N[(x * N[(N[(-1.0 + z), $MachinePrecision] / y$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.7e+89], N[(N[(N[(x + 4.0), $MachinePrecision] - N[(x * z), $MachinePrecision]), $MachinePrecision] / y$95$m), $MachinePrecision], N[(x / N[(y$95$m / N[(z + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.55 \cdot 10^{+36}:\\
\;\;\;\;x \cdot \frac{-1 + z}{y\_m}\\
\mathbf{elif}\;x \leq 2.7 \cdot 10^{+89}:\\
\;\;\;\;\frac{\left(x + 4\right) - x \cdot z}{y\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{y\_m}{z + 1}}\\
\end{array}
\end{array}
if x < -2.54999999999999986e36Initial program 83.6%
fabs-sub83.6%
associate-*l/83.9%
associate-*r/87.7%
fmm-def91.7%
distribute-neg-frac91.7%
+-commutative91.7%
distribute-neg-in91.7%
unsub-neg91.7%
metadata-eval91.7%
Simplified91.7%
add-sqr-sqrt44.7%
fabs-sqr44.7%
add-sqr-sqrt45.2%
fma-undefine45.2%
associate-*r/41.4%
associate-*l/43.1%
div-inv43.0%
sub-neg43.0%
metadata-eval43.0%
distribute-neg-in43.0%
+-commutative43.0%
cancel-sign-sub-inv43.0%
div-inv43.1%
associate-*l/41.4%
sub-div45.4%
Applied egg-rr45.4%
Taylor expanded in x around inf 45.4%
associate-/l*49.2%
sub-neg49.2%
metadata-eval49.2%
Simplified49.2%
if -2.54999999999999986e36 < x < 2.7e89Initial program 98.2%
fabs-sub98.2%
associate-*l/99.9%
associate-*r/92.6%
fmm-def92.6%
distribute-neg-frac92.6%
+-commutative92.6%
distribute-neg-in92.6%
unsub-neg92.6%
metadata-eval92.6%
Simplified92.6%
fma-undefine92.6%
associate-*r/99.9%
associate-*l/98.2%
div-inv98.1%
sub-neg98.1%
metadata-eval98.1%
distribute-neg-in98.1%
+-commutative98.1%
cancel-sign-sub-inv98.1%
div-inv98.2%
fabs-sub98.2%
add-sqr-sqrt38.8%
fabs-sqr38.8%
add-sqr-sqrt40.1%
associate-*l/41.8%
sub-div41.8%
Applied egg-rr41.8%
if 2.7e89 < x Initial program 74.4%
fabs-sub74.4%
associate-*l/65.8%
associate-*r/79.0%
fmm-def88.3%
distribute-neg-frac88.3%
+-commutative88.3%
distribute-neg-in88.3%
unsub-neg88.3%
metadata-eval88.3%
Simplified88.3%
fma-undefine79.0%
associate-*r/65.8%
associate-*l/74.4%
div-inv74.2%
sub-neg74.2%
metadata-eval74.2%
distribute-neg-in74.2%
+-commutative74.2%
cancel-sign-sub-inv74.2%
div-inv74.4%
fabs-sub74.4%
add-sqr-sqrt34.7%
fabs-sqr34.7%
add-sqr-sqrt35.2%
sub-neg35.2%
distribute-rgt-neg-in35.2%
Applied egg-rr35.2%
Taylor expanded in x around -inf 51.3%
mul-1-neg51.3%
div-sub51.3%
associate-/l*49.2%
sub-neg49.2%
metadata-eval49.2%
distribute-rgt-in49.2%
neg-mul-149.2%
sub-neg49.2%
*-lft-identity49.2%
sub-neg49.2%
distribute-rgt-in49.2%
*-rgt-identity49.2%
remove-double-neg49.2%
*-commutative49.2%
mul-1-neg49.2%
associate-*r*49.2%
neg-mul-149.2%
distribute-rgt-neg-in49.2%
mul-1-neg49.2%
distribute-lft-in49.2%
neg-mul-149.2%
+-commutative49.2%
associate-*r*49.2%
Simplified51.3%
clear-num51.3%
un-div-inv51.5%
sub-neg51.5%
add-sqr-sqrt18.7%
sqrt-unprod35.2%
sqr-neg35.2%
sqrt-unprod18.6%
add-sqr-sqrt37.4%
+-commutative37.4%
Applied egg-rr37.4%
Final simplification42.5%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (<= x -2.55e+36) (* x (/ (+ -1.0 z) y_m)) (if (<= x 8.5e-5) (/ (- 4.0 (* x z)) y_m) (/ x (/ y_m (+ z 1.0))))))
y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if (x <= -2.55e+36) {
tmp = x * ((-1.0 + z) / y_m);
} else if (x <= 8.5e-5) {
tmp = (4.0 - (x * z)) / y_m;
} else {
tmp = x / (y_m / (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 <= (-2.55d+36)) then
tmp = x * (((-1.0d0) + z) / y_m)
else if (x <= 8.5d-5) then
tmp = (4.0d0 - (x * z)) / y_m
else
tmp = x / (y_m / (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 <= -2.55e+36) {
tmp = x * ((-1.0 + z) / y_m);
} else if (x <= 8.5e-5) {
tmp = (4.0 - (x * z)) / y_m;
} else {
tmp = x / (y_m / (z + 1.0));
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): tmp = 0 if x <= -2.55e+36: tmp = x * ((-1.0 + z) / y_m) elif x <= 8.5e-5: tmp = (4.0 - (x * z)) / y_m else: tmp = x / (y_m / (z + 1.0)) return tmp
y_m = abs(y) function code(x, y_m, z) tmp = 0.0 if (x <= -2.55e+36) tmp = Float64(x * Float64(Float64(-1.0 + z) / y_m)); elseif (x <= 8.5e-5) tmp = Float64(Float64(4.0 - Float64(x * z)) / y_m); else tmp = Float64(x / Float64(y_m / 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 <= -2.55e+36) tmp = x * ((-1.0 + z) / y_m); elseif (x <= 8.5e-5) tmp = (4.0 - (x * z)) / y_m; else tmp = x / (y_m / (z + 1.0)); end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_] := If[LessEqual[x, -2.55e+36], N[(x * N[(N[(-1.0 + z), $MachinePrecision] / y$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 8.5e-5], N[(N[(4.0 - N[(x * z), $MachinePrecision]), $MachinePrecision] / y$95$m), $MachinePrecision], N[(x / N[(y$95$m / N[(z + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.55 \cdot 10^{+36}:\\
\;\;\;\;x \cdot \frac{-1 + z}{y\_m}\\
\mathbf{elif}\;x \leq 8.5 \cdot 10^{-5}:\\
\;\;\;\;\frac{4 - x \cdot z}{y\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{y\_m}{z + 1}}\\
\end{array}
\end{array}
if x < -2.54999999999999986e36Initial program 83.6%
fabs-sub83.6%
associate-*l/83.9%
associate-*r/87.7%
fmm-def91.7%
distribute-neg-frac91.7%
+-commutative91.7%
distribute-neg-in91.7%
unsub-neg91.7%
metadata-eval91.7%
Simplified91.7%
add-sqr-sqrt44.7%
fabs-sqr44.7%
add-sqr-sqrt45.2%
fma-undefine45.2%
associate-*r/41.4%
associate-*l/43.1%
div-inv43.0%
sub-neg43.0%
metadata-eval43.0%
distribute-neg-in43.0%
+-commutative43.0%
cancel-sign-sub-inv43.0%
div-inv43.1%
associate-*l/41.4%
sub-div45.4%
Applied egg-rr45.4%
Taylor expanded in x around inf 45.4%
associate-/l*49.2%
sub-neg49.2%
metadata-eval49.2%
Simplified49.2%
if -2.54999999999999986e36 < x < 8.500000000000001e-5Initial program 97.9%
fabs-sub97.9%
associate-*l/99.9%
associate-*r/91.4%
fmm-def91.4%
distribute-neg-frac91.4%
+-commutative91.4%
distribute-neg-in91.4%
unsub-neg91.4%
metadata-eval91.4%
Simplified91.4%
fma-undefine91.4%
associate-*r/99.9%
associate-*l/97.9%
div-inv97.9%
sub-neg97.9%
metadata-eval97.9%
distribute-neg-in97.9%
+-commutative97.9%
cancel-sign-sub-inv97.9%
div-inv97.9%
fabs-sub97.9%
add-sqr-sqrt39.6%
fabs-sqr39.6%
add-sqr-sqrt40.9%
associate-*l/42.8%
sub-div42.8%
Applied egg-rr42.8%
Taylor expanded in x around 0 41.3%
if 8.500000000000001e-5 < x Initial program 83.3%
fabs-sub83.3%
associate-*l/77.7%
associate-*r/86.2%
fmm-def92.3%
distribute-neg-frac92.3%
+-commutative92.3%
distribute-neg-in92.3%
unsub-neg92.3%
metadata-eval92.3%
Simplified92.3%
fma-undefine86.2%
associate-*r/77.7%
associate-*l/83.3%
div-inv83.0%
sub-neg83.0%
metadata-eval83.0%
distribute-neg-in83.0%
+-commutative83.0%
cancel-sign-sub-inv83.0%
div-inv83.3%
fabs-sub83.3%
add-sqr-sqrt34.6%
fabs-sqr34.6%
add-sqr-sqrt35.3%
sub-neg35.3%
distribute-rgt-neg-in35.3%
Applied egg-rr35.3%
Taylor expanded in x around -inf 45.4%
mul-1-neg45.4%
div-sub45.4%
associate-/l*44.0%
sub-neg44.0%
metadata-eval44.0%
distribute-rgt-in44.0%
neg-mul-144.0%
sub-neg44.0%
*-lft-identity44.0%
sub-neg44.0%
distribute-rgt-in44.0%
*-rgt-identity44.0%
remove-double-neg44.0%
*-commutative44.0%
mul-1-neg44.0%
associate-*r*44.0%
neg-mul-144.0%
distribute-rgt-neg-in44.0%
mul-1-neg44.0%
distribute-lft-in44.0%
neg-mul-144.0%
+-commutative44.0%
associate-*r*44.0%
Simplified45.4%
clear-num45.4%
un-div-inv45.5%
sub-neg45.5%
add-sqr-sqrt15.0%
sqrt-unprod31.9%
sqr-neg31.9%
sqrt-unprod18.4%
add-sqr-sqrt40.8%
+-commutative40.8%
Applied egg-rr40.8%
Final simplification42.7%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (<= x -3.7) (* x (/ (+ -1.0 z) y_m)) (if (<= x 0.00045) (/ (+ x 4.0) y_m) (/ x (/ y_m (+ z 1.0))))))
y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if (x <= -3.7) {
tmp = x * ((-1.0 + z) / y_m);
} else if (x <= 0.00045) {
tmp = (x + 4.0) / y_m;
} else {
tmp = x / (y_m / (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 <= (-3.7d0)) then
tmp = x * (((-1.0d0) + z) / y_m)
else if (x <= 0.00045d0) then
tmp = (x + 4.0d0) / y_m
else
tmp = x / (y_m / (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 <= -3.7) {
tmp = x * ((-1.0 + z) / y_m);
} else if (x <= 0.00045) {
tmp = (x + 4.0) / y_m;
} else {
tmp = x / (y_m / (z + 1.0));
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): tmp = 0 if x <= -3.7: tmp = x * ((-1.0 + z) / y_m) elif x <= 0.00045: tmp = (x + 4.0) / y_m else: tmp = x / (y_m / (z + 1.0)) return tmp
y_m = abs(y) function code(x, y_m, z) tmp = 0.0 if (x <= -3.7) tmp = Float64(x * Float64(Float64(-1.0 + z) / y_m)); elseif (x <= 0.00045) tmp = Float64(Float64(x + 4.0) / y_m); else tmp = Float64(x / Float64(y_m / 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 <= -3.7) tmp = x * ((-1.0 + z) / y_m); elseif (x <= 0.00045) tmp = (x + 4.0) / y_m; else tmp = x / (y_m / (z + 1.0)); end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_] := If[LessEqual[x, -3.7], N[(x * N[(N[(-1.0 + z), $MachinePrecision] / y$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 0.00045], N[(N[(x + 4.0), $MachinePrecision] / y$95$m), $MachinePrecision], N[(x / N[(y$95$m / N[(z + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.7:\\
\;\;\;\;x \cdot \frac{-1 + z}{y\_m}\\
\mathbf{elif}\;x \leq 0.00045:\\
\;\;\;\;\frac{x + 4}{y\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{y\_m}{z + 1}}\\
\end{array}
\end{array}
if x < -3.7000000000000002Initial program 85.4%
fabs-sub85.4%
associate-*l/85.7%
associate-*r/89.0%
fmm-def92.6%
distribute-neg-frac92.6%
+-commutative92.6%
distribute-neg-in92.6%
unsub-neg92.6%
metadata-eval92.6%
Simplified92.6%
add-sqr-sqrt45.2%
fabs-sqr45.2%
add-sqr-sqrt45.8%
fma-undefine45.8%
associate-*r/42.4%
associate-*l/44.0%
div-inv43.9%
sub-neg43.9%
metadata-eval43.9%
distribute-neg-in43.9%
+-commutative43.9%
cancel-sign-sub-inv43.9%
div-inv44.0%
associate-*l/42.4%
sub-div46.1%
Applied egg-rr46.1%
Taylor expanded in x around inf 45.4%
associate-/l*48.7%
sub-neg48.7%
metadata-eval48.7%
Simplified48.7%
if -3.7000000000000002 < x < 4.4999999999999999e-4Initial program 97.8%
fabs-sub97.8%
associate-*l/99.9%
associate-*r/91.0%
fmm-def91.0%
distribute-neg-frac91.0%
+-commutative91.0%
distribute-neg-in91.0%
unsub-neg91.0%
metadata-eval91.0%
Simplified91.0%
fma-undefine91.0%
associate-*r/99.9%
associate-*l/97.8%
div-inv97.8%
sub-neg97.8%
metadata-eval97.8%
distribute-neg-in97.8%
+-commutative97.8%
cancel-sign-sub-inv97.8%
div-inv97.8%
fabs-sub97.8%
add-sqr-sqrt39.1%
fabs-sqr39.1%
add-sqr-sqrt40.4%
associate-*l/42.5%
sub-div42.5%
Applied egg-rr42.5%
Taylor expanded in z around 0 33.6%
if 4.4999999999999999e-4 < x Initial program 83.3%
fabs-sub83.3%
associate-*l/77.7%
associate-*r/86.2%
fmm-def92.3%
distribute-neg-frac92.3%
+-commutative92.3%
distribute-neg-in92.3%
unsub-neg92.3%
metadata-eval92.3%
Simplified92.3%
fma-undefine86.2%
associate-*r/77.7%
associate-*l/83.3%
div-inv83.0%
sub-neg83.0%
metadata-eval83.0%
distribute-neg-in83.0%
+-commutative83.0%
cancel-sign-sub-inv83.0%
div-inv83.3%
fabs-sub83.3%
add-sqr-sqrt34.6%
fabs-sqr34.6%
add-sqr-sqrt35.3%
sub-neg35.3%
distribute-rgt-neg-in35.3%
Applied egg-rr35.3%
Taylor expanded in x around -inf 45.4%
mul-1-neg45.4%
div-sub45.4%
associate-/l*44.0%
sub-neg44.0%
metadata-eval44.0%
distribute-rgt-in44.0%
neg-mul-144.0%
sub-neg44.0%
*-lft-identity44.0%
sub-neg44.0%
distribute-rgt-in44.0%
*-rgt-identity44.0%
remove-double-neg44.0%
*-commutative44.0%
mul-1-neg44.0%
associate-*r*44.0%
neg-mul-144.0%
distribute-rgt-neg-in44.0%
mul-1-neg44.0%
distribute-lft-in44.0%
neg-mul-144.0%
+-commutative44.0%
associate-*r*44.0%
Simplified45.4%
clear-num45.4%
un-div-inv45.5%
sub-neg45.5%
add-sqr-sqrt15.0%
sqrt-unprod31.9%
sqr-neg31.9%
sqrt-unprod18.4%
add-sqr-sqrt40.8%
+-commutative40.8%
Applied egg-rr40.8%
Final simplification38.7%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (<= x -2.85) (* x (/ (+ -1.0 z) y_m)) (if (<= x 0.00042) (/ (+ x 4.0) y_m) (* x (/ (+ z 1.0) y_m)))))
y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if (x <= -2.85) {
tmp = x * ((-1.0 + z) / y_m);
} else if (x <= 0.00042) {
tmp = (x + 4.0) / y_m;
} else {
tmp = x * ((z + 1.0) / y_m);
}
return tmp;
}
y_m = abs(y)
real(8) function code(x, y_m, z)
real(8), intent (in) :: x
real(8), intent (in) :: y_m
real(8), intent (in) :: z
real(8) :: tmp
if (x <= (-2.85d0)) then
tmp = x * (((-1.0d0) + z) / y_m)
else if (x <= 0.00042d0) then
tmp = (x + 4.0d0) / y_m
else
tmp = x * ((z + 1.0d0) / y_m)
end if
code = tmp
end function
y_m = Math.abs(y);
public static double code(double x, double y_m, double z) {
double tmp;
if (x <= -2.85) {
tmp = x * ((-1.0 + z) / y_m);
} else if (x <= 0.00042) {
tmp = (x + 4.0) / y_m;
} else {
tmp = x * ((z + 1.0) / y_m);
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): tmp = 0 if x <= -2.85: tmp = x * ((-1.0 + z) / y_m) elif x <= 0.00042: tmp = (x + 4.0) / y_m else: tmp = x * ((z + 1.0) / y_m) return tmp
y_m = abs(y) function code(x, y_m, z) tmp = 0.0 if (x <= -2.85) tmp = Float64(x * Float64(Float64(-1.0 + z) / y_m)); elseif (x <= 0.00042) tmp = Float64(Float64(x + 4.0) / y_m); else tmp = Float64(x * Float64(Float64(z + 1.0) / y_m)); end return tmp end
y_m = abs(y); function tmp_2 = code(x, y_m, z) tmp = 0.0; if (x <= -2.85) tmp = x * ((-1.0 + z) / y_m); elseif (x <= 0.00042) tmp = (x + 4.0) / y_m; else tmp = x * ((z + 1.0) / y_m); end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_] := If[LessEqual[x, -2.85], N[(x * N[(N[(-1.0 + z), $MachinePrecision] / y$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 0.00042], N[(N[(x + 4.0), $MachinePrecision] / y$95$m), $MachinePrecision], N[(x * N[(N[(z + 1.0), $MachinePrecision] / y$95$m), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.85:\\
\;\;\;\;x \cdot \frac{-1 + z}{y\_m}\\
\mathbf{elif}\;x \leq 0.00042:\\
\;\;\;\;\frac{x + 4}{y\_m}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{z + 1}{y\_m}\\
\end{array}
\end{array}
if x < -2.85000000000000009Initial program 85.4%
fabs-sub85.4%
associate-*l/85.7%
associate-*r/89.0%
fmm-def92.6%
distribute-neg-frac92.6%
+-commutative92.6%
distribute-neg-in92.6%
unsub-neg92.6%
metadata-eval92.6%
Simplified92.6%
add-sqr-sqrt45.2%
fabs-sqr45.2%
add-sqr-sqrt45.8%
fma-undefine45.8%
associate-*r/42.4%
associate-*l/44.0%
div-inv43.9%
sub-neg43.9%
metadata-eval43.9%
distribute-neg-in43.9%
+-commutative43.9%
cancel-sign-sub-inv43.9%
div-inv44.0%
associate-*l/42.4%
sub-div46.1%
Applied egg-rr46.1%
Taylor expanded in x around inf 45.4%
associate-/l*48.7%
sub-neg48.7%
metadata-eval48.7%
Simplified48.7%
if -2.85000000000000009 < x < 4.2000000000000002e-4Initial program 97.8%
fabs-sub97.8%
associate-*l/99.9%
associate-*r/91.0%
fmm-def91.0%
distribute-neg-frac91.0%
+-commutative91.0%
distribute-neg-in91.0%
unsub-neg91.0%
metadata-eval91.0%
Simplified91.0%
fma-undefine91.0%
associate-*r/99.9%
associate-*l/97.8%
div-inv97.8%
sub-neg97.8%
metadata-eval97.8%
distribute-neg-in97.8%
+-commutative97.8%
cancel-sign-sub-inv97.8%
div-inv97.8%
fabs-sub97.8%
add-sqr-sqrt39.1%
fabs-sqr39.1%
add-sqr-sqrt40.4%
associate-*l/42.5%
sub-div42.5%
Applied egg-rr42.5%
Taylor expanded in z around 0 33.6%
if 4.2000000000000002e-4 < x Initial program 83.3%
fabs-sub83.3%
associate-*l/77.7%
associate-*r/86.2%
fmm-def92.3%
distribute-neg-frac92.3%
+-commutative92.3%
distribute-neg-in92.3%
unsub-neg92.3%
metadata-eval92.3%
Simplified92.3%
fma-undefine86.2%
associate-*r/77.7%
associate-*l/83.3%
div-inv83.0%
sub-neg83.0%
metadata-eval83.0%
distribute-neg-in83.0%
+-commutative83.0%
cancel-sign-sub-inv83.0%
div-inv83.3%
fabs-sub83.3%
add-sqr-sqrt34.6%
fabs-sqr34.6%
add-sqr-sqrt35.3%
sub-neg35.3%
distribute-rgt-neg-in35.3%
Applied egg-rr35.3%
Taylor expanded in x around -inf 45.4%
mul-1-neg45.4%
div-sub45.4%
associate-/l*44.0%
sub-neg44.0%
metadata-eval44.0%
distribute-rgt-in44.0%
neg-mul-144.0%
sub-neg44.0%
*-lft-identity44.0%
sub-neg44.0%
distribute-rgt-in44.0%
*-rgt-identity44.0%
remove-double-neg44.0%
*-commutative44.0%
mul-1-neg44.0%
associate-*r*44.0%
neg-mul-144.0%
distribute-rgt-neg-in44.0%
mul-1-neg44.0%
distribute-lft-in44.0%
neg-mul-144.0%
+-commutative44.0%
associate-*r*44.0%
Simplified45.4%
sub-neg45.4%
add-sqr-sqrt14.9%
sqrt-unprod31.8%
sqr-neg31.8%
sqrt-unprod18.3%
add-sqr-sqrt40.7%
+-commutative40.7%
Applied egg-rr40.7%
Final simplification38.7%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (<= x -1.55) (/ 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 <= -1.55) {
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 <= (-1.55d0)) 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 <= -1.55) {
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 <= -1.55: 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 <= -1.55) 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 <= -1.55) 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, -1.55], 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 -1.55:\\
\;\;\;\;\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 < -1.55000000000000004Initial program 85.4%
fabs-sub85.4%
associate-*l/85.7%
associate-*r/89.0%
fmm-def92.6%
distribute-neg-frac92.6%
+-commutative92.6%
distribute-neg-in92.6%
unsub-neg92.6%
metadata-eval92.6%
Simplified92.6%
add-sqr-sqrt45.2%
fabs-sqr45.2%
add-sqr-sqrt45.8%
fma-undefine45.8%
associate-*r/42.4%
associate-*l/44.0%
div-inv43.9%
sub-neg43.9%
metadata-eval43.9%
distribute-neg-in43.9%
+-commutative43.9%
cancel-sign-sub-inv43.9%
div-inv44.0%
associate-*l/42.4%
sub-div46.1%
Applied egg-rr46.1%
Taylor expanded in z around 0 39.6%
associate-*r/39.6%
distribute-lft-in39.6%
metadata-eval39.6%
neg-mul-139.6%
sub-neg39.6%
Simplified39.6%
Taylor expanded in x around inf 38.9%
neg-mul-138.9%
Simplified38.9%
if -1.55000000000000004 < x < 4Initial program 97.8%
fabs-sub97.8%
associate-*l/99.9%
associate-*r/91.1%
fmm-def91.1%
distribute-neg-frac91.1%
+-commutative91.1%
distribute-neg-in91.1%
unsub-neg91.1%
metadata-eval91.1%
Simplified91.1%
fma-undefine91.1%
associate-*r/99.9%
associate-*l/97.8%
div-inv97.8%
sub-neg97.8%
metadata-eval97.8%
distribute-neg-in97.8%
+-commutative97.8%
cancel-sign-sub-inv97.8%
div-inv97.8%
fabs-sub97.8%
add-sqr-sqrt38.8%
fabs-sqr38.8%
add-sqr-sqrt40.1%
associate-*l/42.2%
sub-div42.2%
Applied egg-rr42.2%
Taylor expanded in x around 0 33.0%
if 4 < x Initial program 83.0%
fabs-sub83.0%
associate-*l/77.3%
associate-*r/86.0%
fmm-def92.2%
distribute-neg-frac92.2%
+-commutative92.2%
distribute-neg-in92.2%
unsub-neg92.2%
metadata-eval92.2%
Simplified92.2%
fma-undefine86.0%
associate-*r/77.3%
associate-*l/83.0%
div-inv82.8%
sub-neg82.8%
metadata-eval82.8%
distribute-neg-in82.8%
+-commutative82.8%
cancel-sign-sub-inv82.8%
div-inv83.0%
fabs-sub83.0%
add-sqr-sqrt35.1%
fabs-sqr35.1%
add-sqr-sqrt35.8%
sub-neg35.8%
distribute-rgt-neg-in35.8%
Applied egg-rr35.8%
Taylor expanded in x around -inf 46.1%
mul-1-neg46.1%
div-sub46.1%
associate-/l*44.7%
sub-neg44.7%
metadata-eval44.7%
distribute-rgt-in44.7%
neg-mul-144.7%
sub-neg44.7%
*-lft-identity44.7%
sub-neg44.7%
distribute-rgt-in44.7%
*-rgt-identity44.7%
remove-double-neg44.7%
*-commutative44.7%
mul-1-neg44.7%
associate-*r*44.7%
neg-mul-144.7%
distribute-rgt-neg-in44.7%
mul-1-neg44.7%
distribute-lft-in44.7%
neg-mul-144.7%
+-commutative44.7%
associate-*r*44.7%
Simplified46.1%
Taylor expanded in z around 0 22.3%
Final simplification31.6%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (<= x -1.7) (* x (/ (+ -1.0 z) y_m)) (/ (+ x 4.0) y_m)))
y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if (x <= -1.7) {
tmp = x * ((-1.0 + z) / y_m);
} else {
tmp = (x + 4.0) / y_m;
}
return tmp;
}
y_m = abs(y)
real(8) function code(x, y_m, z)
real(8), intent (in) :: x
real(8), intent (in) :: y_m
real(8), intent (in) :: z
real(8) :: tmp
if (x <= (-1.7d0)) then
tmp = x * (((-1.0d0) + z) / y_m)
else
tmp = (x + 4.0d0) / y_m
end if
code = tmp
end function
y_m = Math.abs(y);
public static double code(double x, double y_m, double z) {
double tmp;
if (x <= -1.7) {
tmp = x * ((-1.0 + z) / y_m);
} else {
tmp = (x + 4.0) / y_m;
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): tmp = 0 if x <= -1.7: tmp = x * ((-1.0 + z) / y_m) else: tmp = (x + 4.0) / y_m return tmp
y_m = abs(y) function code(x, y_m, z) tmp = 0.0 if (x <= -1.7) tmp = Float64(x * Float64(Float64(-1.0 + z) / y_m)); else tmp = Float64(Float64(x + 4.0) / y_m); end return tmp end
y_m = abs(y); function tmp_2 = code(x, y_m, z) tmp = 0.0; if (x <= -1.7) tmp = x * ((-1.0 + z) / y_m); else tmp = (x + 4.0) / y_m; end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_] := If[LessEqual[x, -1.7], N[(x * N[(N[(-1.0 + z), $MachinePrecision] / 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 -1.7:\\
\;\;\;\;x \cdot \frac{-1 + z}{y\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + 4}{y\_m}\\
\end{array}
\end{array}
if x < -1.69999999999999996Initial program 85.4%
fabs-sub85.4%
associate-*l/85.7%
associate-*r/89.0%
fmm-def92.6%
distribute-neg-frac92.6%
+-commutative92.6%
distribute-neg-in92.6%
unsub-neg92.6%
metadata-eval92.6%
Simplified92.6%
add-sqr-sqrt45.2%
fabs-sqr45.2%
add-sqr-sqrt45.8%
fma-undefine45.8%
associate-*r/42.4%
associate-*l/44.0%
div-inv43.9%
sub-neg43.9%
metadata-eval43.9%
distribute-neg-in43.9%
+-commutative43.9%
cancel-sign-sub-inv43.9%
div-inv44.0%
associate-*l/42.4%
sub-div46.1%
Applied egg-rr46.1%
Taylor expanded in x around inf 45.4%
associate-/l*48.7%
sub-neg48.7%
metadata-eval48.7%
Simplified48.7%
if -1.69999999999999996 < x Initial program 93.0%
fabs-sub93.0%
associate-*l/92.6%
associate-*r/89.4%
fmm-def91.4%
distribute-neg-frac91.4%
+-commutative91.4%
distribute-neg-in91.4%
unsub-neg91.4%
metadata-eval91.4%
Simplified91.4%
fma-undefine89.4%
associate-*r/92.6%
associate-*l/93.0%
div-inv92.9%
sub-neg92.9%
metadata-eval92.9%
distribute-neg-in92.9%
+-commutative92.9%
cancel-sign-sub-inv92.9%
div-inv93.0%
fabs-sub93.0%
add-sqr-sqrt37.6%
fabs-sqr37.6%
add-sqr-sqrt38.7%
associate-*l/39.7%
sub-div43.1%
Applied egg-rr43.1%
Taylor expanded in z around 0 29.9%
Final simplification34.0%
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 85.4%
fabs-sub85.4%
associate-*l/85.7%
associate-*r/89.0%
fmm-def92.6%
distribute-neg-frac92.6%
+-commutative92.6%
distribute-neg-in92.6%
unsub-neg92.6%
metadata-eval92.6%
Simplified92.6%
add-sqr-sqrt45.2%
fabs-sqr45.2%
add-sqr-sqrt45.8%
fma-undefine45.8%
associate-*r/42.4%
associate-*l/44.0%
div-inv43.9%
sub-neg43.9%
metadata-eval43.9%
distribute-neg-in43.9%
+-commutative43.9%
cancel-sign-sub-inv43.9%
div-inv44.0%
associate-*l/42.4%
sub-div46.1%
Applied egg-rr46.1%
Taylor expanded in z around 0 39.6%
associate-*r/39.6%
distribute-lft-in39.6%
metadata-eval39.6%
neg-mul-139.6%
sub-neg39.6%
Simplified39.6%
if -4 < x Initial program 93.0%
fabs-sub93.0%
associate-*l/92.6%
associate-*r/89.4%
fmm-def91.4%
distribute-neg-frac91.4%
+-commutative91.4%
distribute-neg-in91.4%
unsub-neg91.4%
metadata-eval91.4%
Simplified91.4%
fma-undefine89.4%
associate-*r/92.6%
associate-*l/93.0%
div-inv92.9%
sub-neg92.9%
metadata-eval92.9%
distribute-neg-in92.9%
+-commutative92.9%
cancel-sign-sub-inv92.9%
div-inv93.0%
fabs-sub93.0%
add-sqr-sqrt37.6%
fabs-sqr37.6%
add-sqr-sqrt38.7%
associate-*l/39.7%
sub-div43.1%
Applied egg-rr43.1%
Taylor expanded in z around 0 29.9%
Final simplification32.0%
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 85.4%
fabs-sub85.4%
associate-*l/85.7%
associate-*r/89.0%
fmm-def92.6%
distribute-neg-frac92.6%
+-commutative92.6%
distribute-neg-in92.6%
unsub-neg92.6%
metadata-eval92.6%
Simplified92.6%
add-sqr-sqrt45.2%
fabs-sqr45.2%
add-sqr-sqrt45.8%
fma-undefine45.8%
associate-*r/42.4%
associate-*l/44.0%
div-inv43.9%
sub-neg43.9%
metadata-eval43.9%
distribute-neg-in43.9%
+-commutative43.9%
cancel-sign-sub-inv43.9%
div-inv44.0%
associate-*l/42.4%
sub-div46.1%
Applied egg-rr46.1%
Taylor expanded in z around 0 39.6%
associate-*r/39.6%
distribute-lft-in39.6%
metadata-eval39.6%
neg-mul-139.6%
sub-neg39.6%
Simplified39.6%
Taylor expanded in x around inf 38.9%
neg-mul-138.9%
Simplified38.9%
if -4 < x Initial program 93.0%
fabs-sub93.0%
associate-*l/92.6%
associate-*r/89.4%
fmm-def91.4%
distribute-neg-frac91.4%
+-commutative91.4%
distribute-neg-in91.4%
unsub-neg91.4%
metadata-eval91.4%
Simplified91.4%
fma-undefine89.4%
associate-*r/92.6%
associate-*l/93.0%
div-inv92.9%
sub-neg92.9%
metadata-eval92.9%
distribute-neg-in92.9%
+-commutative92.9%
cancel-sign-sub-inv92.9%
div-inv93.0%
fabs-sub93.0%
add-sqr-sqrt37.6%
fabs-sqr37.6%
add-sqr-sqrt38.7%
associate-*l/39.7%
sub-div43.1%
Applied egg-rr43.1%
Taylor expanded in z around 0 29.9%
Final simplification31.9%
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 94.2%
fabs-sub94.2%
associate-*l/95.8%
associate-*r/90.5%
fmm-def91.5%
distribute-neg-frac91.5%
+-commutative91.5%
distribute-neg-in91.5%
unsub-neg91.5%
metadata-eval91.5%
Simplified91.5%
fma-undefine90.5%
associate-*r/95.8%
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-sqrt39.6%
fabs-sqr39.6%
add-sqr-sqrt40.7%
associate-*l/42.7%
sub-div44.8%
Applied egg-rr44.8%
Taylor expanded in x around 0 24.5%
if 4 < x Initial program 83.0%
fabs-sub83.0%
associate-*l/77.3%
associate-*r/86.0%
fmm-def92.2%
distribute-neg-frac92.2%
+-commutative92.2%
distribute-neg-in92.2%
unsub-neg92.2%
metadata-eval92.2%
Simplified92.2%
fma-undefine86.0%
associate-*r/77.3%
associate-*l/83.0%
div-inv82.8%
sub-neg82.8%
metadata-eval82.8%
distribute-neg-in82.8%
+-commutative82.8%
cancel-sign-sub-inv82.8%
div-inv83.0%
fabs-sub83.0%
add-sqr-sqrt35.1%
fabs-sqr35.1%
add-sqr-sqrt35.8%
sub-neg35.8%
distribute-rgt-neg-in35.8%
Applied egg-rr35.8%
Taylor expanded in x around -inf 46.1%
mul-1-neg46.1%
div-sub46.1%
associate-/l*44.7%
sub-neg44.7%
metadata-eval44.7%
distribute-rgt-in44.7%
neg-mul-144.7%
sub-neg44.7%
*-lft-identity44.7%
sub-neg44.7%
distribute-rgt-in44.7%
*-rgt-identity44.7%
remove-double-neg44.7%
*-commutative44.7%
mul-1-neg44.7%
associate-*r*44.7%
neg-mul-144.7%
distribute-rgt-neg-in44.7%
mul-1-neg44.7%
distribute-lft-in44.7%
neg-mul-144.7%
+-commutative44.7%
associate-*r*44.7%
Simplified46.1%
Taylor expanded in z around 0 22.3%
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 91.4%
fabs-sub91.4%
associate-*l/91.1%
associate-*r/89.3%
fmm-def91.7%
distribute-neg-frac91.7%
+-commutative91.7%
distribute-neg-in91.7%
unsub-neg91.7%
metadata-eval91.7%
Simplified91.7%
fma-undefine89.3%
associate-*r/91.1%
associate-*l/91.4%
div-inv91.3%
sub-neg91.3%
metadata-eval91.3%
distribute-neg-in91.3%
+-commutative91.3%
cancel-sign-sub-inv91.3%
div-inv91.4%
fabs-sub91.4%
add-sqr-sqrt38.5%
fabs-sqr38.5%
add-sqr-sqrt39.5%
associate-*l/40.6%
sub-div44.9%
Applied egg-rr44.9%
Taylor expanded in x around 0 19.0%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (/ -4.0 y_m))
y_m = fabs(y);
double code(double x, double y_m, double z) {
return -4.0 / y_m;
}
y_m = abs(y)
real(8) function code(x, y_m, z)
real(8), intent (in) :: x
real(8), intent (in) :: y_m
real(8), intent (in) :: z
code = (-4.0d0) / y_m
end function
y_m = Math.abs(y);
public static double code(double x, double y_m, double z) {
return -4.0 / y_m;
}
y_m = math.fabs(y) def code(x, y_m, z): return -4.0 / y_m
y_m = abs(y) function code(x, y_m, z) return Float64(-4.0 / y_m) end
y_m = abs(y); function tmp = code(x, y_m, z) tmp = -4.0 / y_m; end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_] := N[(-4.0 / y$95$m), $MachinePrecision]
\begin{array}{l}
y_m = \left|y\right|
\\
\frac{-4}{y\_m}
\end{array}
Initial program 91.4%
fabs-sub91.4%
associate-*l/91.1%
associate-*r/89.3%
fmm-def91.7%
distribute-neg-frac91.7%
+-commutative91.7%
distribute-neg-in91.7%
unsub-neg91.7%
metadata-eval91.7%
Simplified91.7%
add-sqr-sqrt52.2%
fabs-sqr52.2%
add-sqr-sqrt53.2%
fma-undefine52.0%
associate-*r/52.0%
associate-*l/53.4%
div-inv53.3%
sub-neg53.3%
metadata-eval53.3%
distribute-neg-in53.3%
+-commutative53.3%
cancel-sign-sub-inv53.3%
div-inv53.4%
associate-*l/52.0%
sub-div53.5%
Applied egg-rr53.5%
Taylor expanded in x around 0 25.8%
herbie shell --seed 2024169
(FPCore (x y z)
:name "fabs fraction 1"
:precision binary64
(fabs (- (/ (+ x 4.0) y) (* (/ x y) z))))