
(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 18 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}
(FPCore (x y z)
:precision binary64
(let* ((t_0 (/ (+ x 4.0) y)) (t_1 (fabs (- t_0 (* z (/ x y))))))
(if (<= t_1 2e-124)
(fabs (- t_0 (/ x (/ y z))))
(if (<= t_1 2e+299) t_1 (fabs (* (/ x y) (+ -1.0 z)))))))
double code(double x, double y, double z) {
double t_0 = (x + 4.0) / y;
double t_1 = fabs((t_0 - (z * (x / y))));
double tmp;
if (t_1 <= 2e-124) {
tmp = fabs((t_0 - (x / (y / z))));
} else if (t_1 <= 2e+299) {
tmp = t_1;
} else {
tmp = fabs(((x / y) * (-1.0 + z)));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = (x + 4.0d0) / y
t_1 = abs((t_0 - (z * (x / y))))
if (t_1 <= 2d-124) then
tmp = abs((t_0 - (x / (y / z))))
else if (t_1 <= 2d+299) then
tmp = t_1
else
tmp = abs(((x / y) * ((-1.0d0) + z)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = (x + 4.0) / y;
double t_1 = Math.abs((t_0 - (z * (x / y))));
double tmp;
if (t_1 <= 2e-124) {
tmp = Math.abs((t_0 - (x / (y / z))));
} else if (t_1 <= 2e+299) {
tmp = t_1;
} else {
tmp = Math.abs(((x / y) * (-1.0 + z)));
}
return tmp;
}
def code(x, y, z): t_0 = (x + 4.0) / y t_1 = math.fabs((t_0 - (z * (x / y)))) tmp = 0 if t_1 <= 2e-124: tmp = math.fabs((t_0 - (x / (y / z)))) elif t_1 <= 2e+299: tmp = t_1 else: tmp = math.fabs(((x / y) * (-1.0 + z))) return tmp
function code(x, y, z) t_0 = Float64(Float64(x + 4.0) / y) t_1 = abs(Float64(t_0 - Float64(z * Float64(x / y)))) tmp = 0.0 if (t_1 <= 2e-124) tmp = abs(Float64(t_0 - Float64(x / Float64(y / z)))); elseif (t_1 <= 2e+299) tmp = t_1; else tmp = abs(Float64(Float64(x / y) * Float64(-1.0 + z))); end return tmp end
function tmp_2 = code(x, y, z) t_0 = (x + 4.0) / y; t_1 = abs((t_0 - (z * (x / y)))); tmp = 0.0; if (t_1 <= 2e-124) tmp = abs((t_0 - (x / (y / z)))); elseif (t_1 <= 2e+299) tmp = t_1; else tmp = abs(((x / y) * (-1.0 + z))); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(x + 4.0), $MachinePrecision] / y), $MachinePrecision]}, Block[{t$95$1 = N[Abs[N[(t$95$0 - N[(z * N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$1, 2e-124], N[Abs[N[(t$95$0 - N[(x / N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$1, 2e+299], t$95$1, N[Abs[N[(N[(x / y), $MachinePrecision] * N[(-1.0 + z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x + 4}{y}\\
t_1 := \left|t\_0 - z \cdot \frac{x}{y}\right|\\
\mathbf{if}\;t\_1 \leq 2 \cdot 10^{-124}:\\
\;\;\;\;\left|t\_0 - \frac{x}{\frac{y}{z}}\right|\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+299}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{x}{y} \cdot \left(-1 + z\right)\right|\\
\end{array}
\end{array}
if (fabs.f64 (-.f64 (/.f64 (+.f64 x #s(literal 4 binary64)) y) (*.f64 (/.f64 x y) z))) < 1.99999999999999987e-124Initial program 83.7%
associate-*l/99.8%
associate-*r/99.8%
clear-num99.7%
un-div-inv99.7%
Applied egg-rr99.7%
if 1.99999999999999987e-124 < (fabs.f64 (-.f64 (/.f64 (+.f64 x #s(literal 4 binary64)) y) (*.f64 (/.f64 x y) z))) < 2.0000000000000001e299Initial program 99.9%
if 2.0000000000000001e299 < (fabs.f64 (-.f64 (/.f64 (+.f64 x #s(literal 4 binary64)) y) (*.f64 (/.f64 x y) z))) Initial program 71.2%
fabs-sub71.2%
associate-*l/75.0%
associate-*r/75.0%
fmm-def80.8%
distribute-neg-frac80.8%
+-commutative80.8%
distribute-neg-in80.8%
unsub-neg80.8%
metadata-eval80.8%
Simplified80.8%
Taylor expanded in x around inf 100.0%
div-sub100.0%
*-commutative100.0%
associate-*l/100.0%
associate-/l*100.0%
sub-neg100.0%
remove-double-neg100.0%
neg-mul-1100.0%
metadata-eval100.0%
metadata-eval100.0%
distribute-lft-in100.0%
+-commutative100.0%
distribute-lft-in100.0%
metadata-eval100.0%
neg-mul-1100.0%
remove-double-neg100.0%
Simplified100.0%
Final simplification99.9%
(FPCore (x y z) :precision binary64 (let* ((t_0 (fabs (- (/ (+ x 4.0) y) (* z (/ x y)))))) (if (<= t_0 2e+299) t_0 (fabs (* (/ x y) (+ -1.0 z))))))
double code(double x, double y, double z) {
double t_0 = fabs((((x + 4.0) / y) - (z * (x / y))));
double tmp;
if (t_0 <= 2e+299) {
tmp = t_0;
} else {
tmp = fabs(((x / y) * (-1.0 + z)));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = abs((((x + 4.0d0) / y) - (z * (x / y))))
if (t_0 <= 2d+299) then
tmp = t_0
else
tmp = abs(((x / y) * ((-1.0d0) + z)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = Math.abs((((x + 4.0) / y) - (z * (x / y))));
double tmp;
if (t_0 <= 2e+299) {
tmp = t_0;
} else {
tmp = Math.abs(((x / y) * (-1.0 + z)));
}
return tmp;
}
def code(x, y, z): t_0 = math.fabs((((x + 4.0) / y) - (z * (x / y)))) tmp = 0 if t_0 <= 2e+299: tmp = t_0 else: tmp = math.fabs(((x / y) * (-1.0 + z))) return tmp
function code(x, y, z) t_0 = abs(Float64(Float64(Float64(x + 4.0) / y) - Float64(z * Float64(x / y)))) tmp = 0.0 if (t_0 <= 2e+299) tmp = t_0; else tmp = abs(Float64(Float64(x / y) * Float64(-1.0 + z))); end return tmp end
function tmp_2 = code(x, y, z) t_0 = abs((((x + 4.0) / y) - (z * (x / y)))); tmp = 0.0; if (t_0 <= 2e+299) tmp = t_0; else tmp = abs(((x / y) * (-1.0 + z))); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[Abs[N[(N[(N[(x + 4.0), $MachinePrecision] / y), $MachinePrecision] - N[(z * N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$0, 2e+299], t$95$0, N[Abs[N[(N[(x / y), $MachinePrecision] * N[(-1.0 + z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left|\frac{x + 4}{y} - z \cdot \frac{x}{y}\right|\\
\mathbf{if}\;t\_0 \leq 2 \cdot 10^{+299}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{x}{y} \cdot \left(-1 + z\right)\right|\\
\end{array}
\end{array}
if (fabs.f64 (-.f64 (/.f64 (+.f64 x #s(literal 4 binary64)) y) (*.f64 (/.f64 x y) z))) < 2.0000000000000001e299Initial program 97.0%
if 2.0000000000000001e299 < (fabs.f64 (-.f64 (/.f64 (+.f64 x #s(literal 4 binary64)) y) (*.f64 (/.f64 x y) z))) Initial program 71.2%
fabs-sub71.2%
associate-*l/75.0%
associate-*r/75.0%
fmm-def80.8%
distribute-neg-frac80.8%
+-commutative80.8%
distribute-neg-in80.8%
unsub-neg80.8%
metadata-eval80.8%
Simplified80.8%
Taylor expanded in x around inf 100.0%
div-sub100.0%
*-commutative100.0%
associate-*l/100.0%
associate-/l*100.0%
sub-neg100.0%
remove-double-neg100.0%
neg-mul-1100.0%
metadata-eval100.0%
metadata-eval100.0%
distribute-lft-in100.0%
+-commutative100.0%
distribute-lft-in100.0%
metadata-eval100.0%
neg-mul-1100.0%
remove-double-neg100.0%
Simplified100.0%
Final simplification97.6%
(FPCore (x y z) :precision binary64 (if (<= y 3.4e-58) (fabs (* (/ -1.0 y) (fma x z (- -4.0 x)))) (fabs (fma x (/ z y) (/ (- -4.0 x) y)))))
double code(double x, double y, double z) {
double tmp;
if (y <= 3.4e-58) {
tmp = fabs(((-1.0 / y) * fma(x, z, (-4.0 - x))));
} else {
tmp = fabs(fma(x, (z / y), ((-4.0 - x) / y)));
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (y <= 3.4e-58) tmp = abs(Float64(Float64(-1.0 / y) * fma(x, z, Float64(-4.0 - x)))); else tmp = abs(fma(x, Float64(z / y), Float64(Float64(-4.0 - x) / y))); end return tmp end
code[x_, y_, z_] := If[LessEqual[y, 3.4e-58], N[Abs[N[(N[(-1.0 / y), $MachinePrecision] * N[(x * z + N[(-4.0 - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(x * N[(z / y), $MachinePrecision] + N[(N[(-4.0 - x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 3.4 \cdot 10^{-58}:\\
\;\;\;\;\left|\frac{-1}{y} \cdot \mathsf{fma}\left(x, z, -4 - x\right)\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\mathsf{fma}\left(x, \frac{z}{y}, \frac{-4 - x}{y}\right)\right|\\
\end{array}
\end{array}
if y < 3.39999999999999973e-58Initial program 89.9%
Simplified97.8%
if 3.39999999999999973e-58 < y Initial program 96.2%
fabs-sub96.2%
associate-*l/91.1%
associate-*r/99.8%
fmm-def99.8%
distribute-neg-frac99.8%
+-commutative99.8%
distribute-neg-in99.8%
unsub-neg99.8%
metadata-eval99.8%
Simplified99.8%
(FPCore (x y z) :precision binary64 (if (<= y 1.3e-76) (fabs (* (/ -1.0 y) (fma x z (- -4.0 x)))) (fabs (- (/ (+ x 4.0) y) (/ x (/ y z))))))
double code(double x, double y, double z) {
double tmp;
if (y <= 1.3e-76) {
tmp = fabs(((-1.0 / y) * fma(x, z, (-4.0 - x))));
} else {
tmp = fabs((((x + 4.0) / y) - (x / (y / z))));
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (y <= 1.3e-76) tmp = abs(Float64(Float64(-1.0 / y) * fma(x, z, Float64(-4.0 - x)))); else tmp = abs(Float64(Float64(Float64(x + 4.0) / y) - Float64(x / Float64(y / z)))); end return tmp end
code[x_, y_, z_] := If[LessEqual[y, 1.3e-76], N[Abs[N[(N[(-1.0 / y), $MachinePrecision] * N[(x * z + N[(-4.0 - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[(N[(x + 4.0), $MachinePrecision] / y), $MachinePrecision] - N[(x / N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.3 \cdot 10^{-76}:\\
\;\;\;\;\left|\frac{-1}{y} \cdot \mathsf{fma}\left(x, z, -4 - x\right)\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{x + 4}{y} - \frac{x}{\frac{y}{z}}\right|\\
\end{array}
\end{array}
if y < 1.3e-76Initial program 89.5%
Simplified97.7%
if 1.3e-76 < y Initial program 96.5%
associate-*l/91.8%
associate-*r/99.8%
clear-num99.7%
un-div-inv99.9%
Applied egg-rr99.9%
(FPCore (x y z) :precision binary64 (if (or (<= x -3.3e-11) (not (<= x 3e-11))) (fabs (* (/ x y) (+ -1.0 z))) (+ (/ (+ x 4.0) y) (* (/ -1.0 y) (* x z)))))
double code(double x, double y, double z) {
double tmp;
if ((x <= -3.3e-11) || !(x <= 3e-11)) {
tmp = fabs(((x / y) * (-1.0 + z)));
} else {
tmp = ((x + 4.0) / y) + ((-1.0 / y) * (x * z));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((x <= (-3.3d-11)) .or. (.not. (x <= 3d-11))) then
tmp = abs(((x / y) * ((-1.0d0) + z)))
else
tmp = ((x + 4.0d0) / y) + (((-1.0d0) / y) * (x * z))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((x <= -3.3e-11) || !(x <= 3e-11)) {
tmp = Math.abs(((x / y) * (-1.0 + z)));
} else {
tmp = ((x + 4.0) / y) + ((-1.0 / y) * (x * z));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -3.3e-11) or not (x <= 3e-11): tmp = math.fabs(((x / y) * (-1.0 + z))) else: tmp = ((x + 4.0) / y) + ((-1.0 / y) * (x * z)) return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -3.3e-11) || !(x <= 3e-11)) tmp = abs(Float64(Float64(x / y) * Float64(-1.0 + z))); else tmp = Float64(Float64(Float64(x + 4.0) / y) + Float64(Float64(-1.0 / y) * Float64(x * z))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((x <= -3.3e-11) || ~((x <= 3e-11))) tmp = abs(((x / y) * (-1.0 + z))); else tmp = ((x + 4.0) / y) + ((-1.0 / y) * (x * z)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -3.3e-11], N[Not[LessEqual[x, 3e-11]], $MachinePrecision]], N[Abs[N[(N[(x / y), $MachinePrecision] * N[(-1.0 + z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[(N[(x + 4.0), $MachinePrecision] / y), $MachinePrecision] + N[(N[(-1.0 / y), $MachinePrecision] * N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.3 \cdot 10^{-11} \lor \neg \left(x \leq 3 \cdot 10^{-11}\right):\\
\;\;\;\;\left|\frac{x}{y} \cdot \left(-1 + z\right)\right|\\
\mathbf{else}:\\
\;\;\;\;\frac{x + 4}{y} + \frac{-1}{y} \cdot \left(x \cdot z\right)\\
\end{array}
\end{array}
if x < -3.3000000000000002e-11 or 3e-11 < x Initial program 88.9%
fabs-sub88.9%
associate-*l/82.8%
associate-*r/90.4%
fmm-def92.6%
distribute-neg-frac92.6%
+-commutative92.6%
distribute-neg-in92.6%
unsub-neg92.6%
metadata-eval92.6%
Simplified92.6%
Taylor expanded in x around inf 99.1%
div-sub99.1%
*-commutative99.1%
associate-*l/91.7%
associate-/l*99.3%
sub-neg99.3%
remove-double-neg99.3%
neg-mul-199.3%
metadata-eval99.3%
metadata-eval99.3%
distribute-lft-in99.3%
+-commutative99.3%
distribute-lft-in99.3%
metadata-eval99.3%
neg-mul-199.3%
remove-double-neg99.3%
Simplified99.3%
if -3.3000000000000002e-11 < x < 3e-11Initial program 95.0%
Simplified99.9%
add-sqr-sqrt45.9%
fabs-sqr45.9%
add-sqr-sqrt47.2%
fma-undefine47.2%
distribute-rgt-in47.2%
sub-neg47.2%
metadata-eval47.2%
distribute-neg-in47.2%
+-commutative47.2%
frac-2neg47.2%
metadata-eval47.2%
div-inv47.2%
frac-2neg47.2%
Applied egg-rr47.2%
Final simplification75.1%
(FPCore (x y z)
:precision binary64
(if (<= x -4.0)
(/ (+ -1.0 z) (/ y x))
(if (<= x 1e+31)
(+ (/ (+ x 4.0) y) (* (/ -1.0 y) (* x z)))
(* (/ x y) (- 1.0 z)))))
double code(double x, double y, double z) {
double tmp;
if (x <= -4.0) {
tmp = (-1.0 + z) / (y / x);
} else if (x <= 1e+31) {
tmp = ((x + 4.0) / y) + ((-1.0 / y) * (x * z));
} else {
tmp = (x / y) * (1.0 - z);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x <= (-4.0d0)) then
tmp = ((-1.0d0) + z) / (y / x)
else if (x <= 1d+31) then
tmp = ((x + 4.0d0) / y) + (((-1.0d0) / y) * (x * z))
else
tmp = (x / y) * (1.0d0 - z)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -4.0) {
tmp = (-1.0 + z) / (y / x);
} else if (x <= 1e+31) {
tmp = ((x + 4.0) / y) + ((-1.0 / y) * (x * z));
} else {
tmp = (x / y) * (1.0 - z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -4.0: tmp = (-1.0 + z) / (y / x) elif x <= 1e+31: tmp = ((x + 4.0) / y) + ((-1.0 / y) * (x * z)) else: tmp = (x / y) * (1.0 - z) return tmp
function code(x, y, z) tmp = 0.0 if (x <= -4.0) tmp = Float64(Float64(-1.0 + z) / Float64(y / x)); elseif (x <= 1e+31) tmp = Float64(Float64(Float64(x + 4.0) / y) + Float64(Float64(-1.0 / y) * Float64(x * z))); else tmp = Float64(Float64(x / y) * Float64(1.0 - z)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -4.0) tmp = (-1.0 + z) / (y / x); elseif (x <= 1e+31) tmp = ((x + 4.0) / y) + ((-1.0 / y) * (x * z)); else tmp = (x / y) * (1.0 - z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -4.0], N[(N[(-1.0 + z), $MachinePrecision] / N[(y / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1e+31], N[(N[(N[(x + 4.0), $MachinePrecision] / y), $MachinePrecision] + N[(N[(-1.0 / y), $MachinePrecision] * N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] * N[(1.0 - z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4:\\
\;\;\;\;\frac{-1 + z}{\frac{y}{x}}\\
\mathbf{elif}\;x \leq 10^{+31}:\\
\;\;\;\;\frac{x + 4}{y} + \frac{-1}{y} \cdot \left(x \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} \cdot \left(1 - z\right)\\
\end{array}
\end{array}
if x < -4Initial program 87.4%
fabs-sub87.4%
associate-*l/80.6%
associate-*r/87.4%
fmm-def90.9%
distribute-neg-frac90.9%
+-commutative90.9%
distribute-neg-in90.9%
unsub-neg90.9%
metadata-eval90.9%
Simplified90.9%
Taylor expanded in x around inf 99.6%
div-sub99.7%
*-commutative99.7%
associate-*l/93.1%
associate-/l*100.0%
sub-neg100.0%
remove-double-neg100.0%
neg-mul-1100.0%
metadata-eval100.0%
metadata-eval100.0%
distribute-lft-in100.0%
+-commutative100.0%
distribute-lft-in100.0%
metadata-eval100.0%
neg-mul-1100.0%
remove-double-neg100.0%
Simplified100.0%
add-sqr-sqrt64.0%
fabs-sqr64.0%
add-sqr-sqrt64.5%
+-commutative64.5%
clear-num64.4%
un-div-inv64.4%
+-commutative64.4%
Applied egg-rr64.4%
if -4 < x < 9.9999999999999996e30Initial program 95.5%
Simplified99.8%
add-sqr-sqrt45.6%
fabs-sqr45.6%
add-sqr-sqrt46.9%
fma-undefine46.9%
distribute-rgt-in46.9%
sub-neg46.9%
metadata-eval46.9%
distribute-neg-in46.9%
+-commutative46.9%
frac-2neg46.9%
metadata-eval46.9%
div-inv46.9%
frac-2neg46.9%
Applied egg-rr46.9%
if 9.9999999999999996e30 < x Initial program 87.6%
fabs-sub87.6%
associate-*l/80.6%
associate-*r/90.7%
fmm-def92.2%
distribute-neg-frac92.2%
+-commutative92.2%
distribute-neg-in92.2%
unsub-neg92.2%
metadata-eval92.2%
Simplified92.2%
fma-undefine90.7%
associate-*r/80.6%
associate-*l/87.6%
div-inv87.5%
sub-neg87.5%
metadata-eval87.5%
distribute-neg-in87.5%
+-commutative87.5%
cancel-sign-sub-inv87.5%
div-inv87.6%
fabs-sub87.6%
add-sqr-sqrt48.8%
fabs-sqr48.8%
add-sqr-sqrt49.4%
sub-neg49.4%
distribute-rgt-neg-in49.4%
Applied egg-rr49.4%
Taylor expanded in x around inf 49.4%
distribute-rgt-neg-out49.4%
distribute-lft-neg-in49.4%
add-sqr-sqrt14.0%
sqrt-unprod26.9%
sqr-neg26.9%
sqrt-unprod18.7%
add-sqr-sqrt41.8%
cancel-sign-sub-inv41.8%
*-un-lft-identity41.8%
*-commutative41.8%
distribute-rgt-out--51.1%
add-sqr-sqrt27.9%
sqrt-unprod42.3%
sqr-neg42.3%
sqrt-unprod20.1%
add-sqr-sqrt55.6%
Applied egg-rr55.6%
Final simplification52.9%
(FPCore (x y z) :precision binary64 (if (<= x -5.8) (/ (+ -1.0 z) (/ y x)) (if (<= x 5e+25) (/ (- (+ x 4.0) (* x z)) y) (* (/ x y) (- 1.0 z)))))
double code(double x, double y, double z) {
double tmp;
if (x <= -5.8) {
tmp = (-1.0 + z) / (y / x);
} else if (x <= 5e+25) {
tmp = ((x + 4.0) - (x * z)) / y;
} else {
tmp = (x / y) * (1.0 - z);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x <= (-5.8d0)) then
tmp = ((-1.0d0) + z) / (y / x)
else if (x <= 5d+25) then
tmp = ((x + 4.0d0) - (x * z)) / y
else
tmp = (x / y) * (1.0d0 - z)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -5.8) {
tmp = (-1.0 + z) / (y / x);
} else if (x <= 5e+25) {
tmp = ((x + 4.0) - (x * z)) / y;
} else {
tmp = (x / y) * (1.0 - z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -5.8: tmp = (-1.0 + z) / (y / x) elif x <= 5e+25: tmp = ((x + 4.0) - (x * z)) / y else: tmp = (x / y) * (1.0 - z) return tmp
function code(x, y, z) tmp = 0.0 if (x <= -5.8) tmp = Float64(Float64(-1.0 + z) / Float64(y / x)); elseif (x <= 5e+25) tmp = Float64(Float64(Float64(x + 4.0) - Float64(x * z)) / y); else tmp = Float64(Float64(x / y) * Float64(1.0 - z)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -5.8) tmp = (-1.0 + z) / (y / x); elseif (x <= 5e+25) tmp = ((x + 4.0) - (x * z)) / y; else tmp = (x / y) * (1.0 - z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -5.8], N[(N[(-1.0 + z), $MachinePrecision] / N[(y / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 5e+25], N[(N[(N[(x + 4.0), $MachinePrecision] - N[(x * z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], N[(N[(x / y), $MachinePrecision] * N[(1.0 - z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -5.8:\\
\;\;\;\;\frac{-1 + z}{\frac{y}{x}}\\
\mathbf{elif}\;x \leq 5 \cdot 10^{+25}:\\
\;\;\;\;\frac{\left(x + 4\right) - x \cdot z}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} \cdot \left(1 - z\right)\\
\end{array}
\end{array}
if x < -5.79999999999999982Initial program 87.4%
fabs-sub87.4%
associate-*l/80.6%
associate-*r/87.4%
fmm-def90.9%
distribute-neg-frac90.9%
+-commutative90.9%
distribute-neg-in90.9%
unsub-neg90.9%
metadata-eval90.9%
Simplified90.9%
Taylor expanded in x around inf 99.6%
div-sub99.7%
*-commutative99.7%
associate-*l/93.1%
associate-/l*100.0%
sub-neg100.0%
remove-double-neg100.0%
neg-mul-1100.0%
metadata-eval100.0%
metadata-eval100.0%
distribute-lft-in100.0%
+-commutative100.0%
distribute-lft-in100.0%
metadata-eval100.0%
neg-mul-1100.0%
remove-double-neg100.0%
Simplified100.0%
add-sqr-sqrt64.0%
fabs-sqr64.0%
add-sqr-sqrt64.5%
+-commutative64.5%
clear-num64.4%
un-div-inv64.4%
+-commutative64.4%
Applied egg-rr64.4%
if -5.79999999999999982 < x < 5.00000000000000024e25Initial program 95.4%
fabs-sub95.4%
associate-*l/99.9%
associate-*r/92.9%
fmm-def92.9%
distribute-neg-frac92.9%
+-commutative92.9%
distribute-neg-in92.9%
unsub-neg92.9%
metadata-eval92.9%
Simplified92.9%
fma-undefine92.9%
associate-*r/99.9%
associate-*l/95.4%
div-inv95.4%
sub-neg95.4%
metadata-eval95.4%
distribute-neg-in95.4%
+-commutative95.4%
cancel-sign-sub-inv95.4%
div-inv95.4%
fabs-sub95.4%
add-sqr-sqrt42.0%
fabs-sqr42.0%
add-sqr-sqrt43.3%
associate-*l/46.8%
sub-div46.8%
Applied egg-rr46.8%
if 5.00000000000000024e25 < x Initial program 88.0%
fabs-sub88.0%
associate-*l/81.2%
associate-*r/91.0%
fmm-def92.4%
distribute-neg-frac92.4%
+-commutative92.4%
distribute-neg-in92.4%
unsub-neg92.4%
metadata-eval92.4%
Simplified92.4%
fma-undefine91.0%
associate-*r/81.2%
associate-*l/88.0%
div-inv87.8%
sub-neg87.8%
metadata-eval87.8%
distribute-neg-in87.8%
+-commutative87.8%
cancel-sign-sub-inv87.8%
div-inv88.0%
fabs-sub88.0%
add-sqr-sqrt48.8%
fabs-sqr48.8%
add-sqr-sqrt49.5%
sub-neg49.5%
distribute-rgt-neg-in49.5%
Applied egg-rr49.5%
Taylor expanded in x around inf 49.5%
distribute-rgt-neg-out49.5%
distribute-lft-neg-in49.5%
add-sqr-sqrt15.0%
sqrt-unprod27.6%
sqr-neg27.6%
sqrt-unprod18.1%
add-sqr-sqrt40.6%
cancel-sign-sub-inv40.6%
*-un-lft-identity40.6%
*-commutative40.6%
distribute-rgt-out--49.6%
add-sqr-sqrt27.1%
sqrt-unprod42.5%
sqr-neg42.5%
sqrt-unprod21.0%
add-sqr-sqrt55.5%
Applied egg-rr55.5%
(FPCore (x y z) :precision binary64 (if (<= x -1350.0) (/ (+ -1.0 z) (/ y x)) (if (<= x 0.000225) (/ (- 4.0 (* x z)) y) (* (/ x y) (- 1.0 z)))))
double code(double x, double y, double z) {
double tmp;
if (x <= -1350.0) {
tmp = (-1.0 + z) / (y / x);
} else if (x <= 0.000225) {
tmp = (4.0 - (x * z)) / y;
} else {
tmp = (x / y) * (1.0 - z);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x <= (-1350.0d0)) then
tmp = ((-1.0d0) + z) / (y / x)
else if (x <= 0.000225d0) then
tmp = (4.0d0 - (x * z)) / y
else
tmp = (x / y) * (1.0d0 - z)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -1350.0) {
tmp = (-1.0 + z) / (y / x);
} else if (x <= 0.000225) {
tmp = (4.0 - (x * z)) / y;
} else {
tmp = (x / y) * (1.0 - z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -1350.0: tmp = (-1.0 + z) / (y / x) elif x <= 0.000225: tmp = (4.0 - (x * z)) / y else: tmp = (x / y) * (1.0 - z) return tmp
function code(x, y, z) tmp = 0.0 if (x <= -1350.0) tmp = Float64(Float64(-1.0 + z) / Float64(y / x)); elseif (x <= 0.000225) tmp = Float64(Float64(4.0 - Float64(x * z)) / y); else tmp = Float64(Float64(x / y) * Float64(1.0 - z)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -1350.0) tmp = (-1.0 + z) / (y / x); elseif (x <= 0.000225) tmp = (4.0 - (x * z)) / y; else tmp = (x / y) * (1.0 - z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -1350.0], N[(N[(-1.0 + z), $MachinePrecision] / N[(y / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 0.000225], N[(N[(4.0 - N[(x * z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], N[(N[(x / y), $MachinePrecision] * N[(1.0 - z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1350:\\
\;\;\;\;\frac{-1 + z}{\frac{y}{x}}\\
\mathbf{elif}\;x \leq 0.000225:\\
\;\;\;\;\frac{4 - x \cdot z}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} \cdot \left(1 - z\right)\\
\end{array}
\end{array}
if x < -1350Initial program 87.4%
fabs-sub87.4%
associate-*l/80.6%
associate-*r/87.4%
fmm-def90.9%
distribute-neg-frac90.9%
+-commutative90.9%
distribute-neg-in90.9%
unsub-neg90.9%
metadata-eval90.9%
Simplified90.9%
Taylor expanded in x around inf 99.6%
div-sub99.7%
*-commutative99.7%
associate-*l/93.1%
associate-/l*100.0%
sub-neg100.0%
remove-double-neg100.0%
neg-mul-1100.0%
metadata-eval100.0%
metadata-eval100.0%
distribute-lft-in100.0%
+-commutative100.0%
distribute-lft-in100.0%
metadata-eval100.0%
neg-mul-1100.0%
remove-double-neg100.0%
Simplified100.0%
add-sqr-sqrt64.0%
fabs-sqr64.0%
add-sqr-sqrt64.5%
+-commutative64.5%
clear-num64.4%
un-div-inv64.4%
+-commutative64.4%
Applied egg-rr64.4%
if -1350 < x < 2.2499999999999999e-4Initial program 95.1%
fabs-sub95.1%
associate-*l/99.9%
associate-*r/92.4%
fmm-def92.4%
distribute-neg-frac92.4%
+-commutative92.4%
distribute-neg-in92.4%
unsub-neg92.4%
metadata-eval92.4%
Simplified92.4%
fma-undefine92.4%
associate-*r/99.9%
associate-*l/95.1%
div-inv95.1%
sub-neg95.1%
metadata-eval95.1%
distribute-neg-in95.1%
+-commutative95.1%
cancel-sign-sub-inv95.1%
div-inv95.1%
fabs-sub95.1%
add-sqr-sqrt42.3%
fabs-sqr42.3%
add-sqr-sqrt43.7%
associate-*l/47.4%
sub-div47.4%
Applied egg-rr47.4%
Taylor expanded in x around 0 47.4%
if 2.2499999999999999e-4 < x Initial program 89.3%
fabs-sub89.3%
associate-*l/83.2%
associate-*r/91.9%
fmm-def93.2%
distribute-neg-frac93.2%
+-commutative93.2%
distribute-neg-in93.2%
unsub-neg93.2%
metadata-eval93.2%
Simplified93.2%
fma-undefine91.9%
associate-*r/83.2%
associate-*l/89.3%
div-inv89.1%
sub-neg89.1%
metadata-eval89.1%
distribute-neg-in89.1%
+-commutative89.1%
cancel-sign-sub-inv89.1%
div-inv89.3%
fabs-sub89.3%
add-sqr-sqrt47.6%
fabs-sqr47.6%
add-sqr-sqrt48.3%
sub-neg48.3%
distribute-rgt-neg-in48.3%
Applied egg-rr48.3%
Taylor expanded in x around inf 48.3%
distribute-rgt-neg-out48.3%
distribute-lft-neg-in48.3%
add-sqr-sqrt16.1%
sqrt-unprod31.4%
sqr-neg31.4%
sqrt-unprod20.2%
add-sqr-sqrt41.7%
cancel-sign-sub-inv41.7%
*-un-lft-identity41.7%
*-commutative41.7%
distribute-rgt-out--49.7%
add-sqr-sqrt28.2%
sqrt-unprod44.7%
sqr-neg44.7%
sqrt-unprod21.4%
add-sqr-sqrt53.6%
Applied egg-rr53.6%
(FPCore (x y z) :precision binary64 (if (<= x -2.9e-11) (/ x (/ y (+ -1.0 z))) (if (<= x 0.000205) (+ (/ x y) (/ 4.0 y)) (* (/ x y) (- 1.0 z)))))
double code(double x, double y, double z) {
double tmp;
if (x <= -2.9e-11) {
tmp = x / (y / (-1.0 + z));
} else if (x <= 0.000205) {
tmp = (x / y) + (4.0 / y);
} else {
tmp = (x / y) * (1.0 - z);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x <= (-2.9d-11)) then
tmp = x / (y / ((-1.0d0) + z))
else if (x <= 0.000205d0) then
tmp = (x / y) + (4.0d0 / y)
else
tmp = (x / y) * (1.0d0 - z)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -2.9e-11) {
tmp = x / (y / (-1.0 + z));
} else if (x <= 0.000205) {
tmp = (x / y) + (4.0 / y);
} else {
tmp = (x / y) * (1.0 - z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -2.9e-11: tmp = x / (y / (-1.0 + z)) elif x <= 0.000205: tmp = (x / y) + (4.0 / y) else: tmp = (x / y) * (1.0 - z) return tmp
function code(x, y, z) tmp = 0.0 if (x <= -2.9e-11) tmp = Float64(x / Float64(y / Float64(-1.0 + z))); elseif (x <= 0.000205) tmp = Float64(Float64(x / y) + Float64(4.0 / y)); else tmp = Float64(Float64(x / y) * Float64(1.0 - z)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -2.9e-11) tmp = x / (y / (-1.0 + z)); elseif (x <= 0.000205) tmp = (x / y) + (4.0 / y); else tmp = (x / y) * (1.0 - z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -2.9e-11], N[(x / N[(y / N[(-1.0 + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 0.000205], N[(N[(x / y), $MachinePrecision] + N[(4.0 / y), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] * N[(1.0 - z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.9 \cdot 10^{-11}:\\
\;\;\;\;\frac{x}{\frac{y}{-1 + z}}\\
\mathbf{elif}\;x \leq 0.000205:\\
\;\;\;\;\frac{x}{y} + \frac{4}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} \cdot \left(1 - z\right)\\
\end{array}
\end{array}
if x < -2.9e-11Initial program 88.1%
fabs-sub88.1%
associate-*l/81.8%
associate-*r/88.2%
fmm-def91.5%
distribute-neg-frac91.5%
+-commutative91.5%
distribute-neg-in91.5%
unsub-neg91.5%
metadata-eval91.5%
Simplified91.5%
Taylor expanded in x around inf 99.6%
div-sub99.7%
*-commutative99.7%
associate-*l/93.5%
associate-/l*99.9%
sub-neg99.9%
remove-double-neg99.9%
neg-mul-199.9%
metadata-eval99.9%
metadata-eval99.9%
distribute-lft-in99.9%
+-commutative99.9%
distribute-lft-in99.9%
metadata-eval99.9%
neg-mul-199.9%
remove-double-neg99.9%
Simplified99.9%
add-sqr-sqrt61.4%
fabs-sqr61.4%
add-sqr-sqrt61.9%
+-commutative61.9%
*-commutative61.9%
associate-*l/55.5%
associate-*r/61.6%
clear-num61.6%
un-div-inv61.8%
+-commutative61.8%
Applied egg-rr61.8%
if -2.9e-11 < x < 2.05e-4Initial program 95.0%
fabs-sub95.0%
associate-*l/99.9%
associate-*r/92.2%
fmm-def92.2%
distribute-neg-frac92.2%
+-commutative92.2%
distribute-neg-in92.2%
unsub-neg92.2%
metadata-eval92.2%
Simplified92.2%
fma-undefine92.2%
associate-*r/99.9%
associate-*l/95.0%
div-inv95.0%
sub-neg95.0%
metadata-eval95.0%
distribute-neg-in95.0%
+-commutative95.0%
cancel-sign-sub-inv95.0%
div-inv95.0%
fabs-sub95.0%
add-sqr-sqrt41.3%
fabs-sqr41.3%
add-sqr-sqrt42.7%
associate-*l/46.5%
sub-div46.5%
Applied egg-rr46.5%
Taylor expanded in z around 0 38.3%
Taylor expanded in x around 0 38.3%
associate-*r/38.3%
metadata-eval38.3%
+-commutative38.3%
Simplified38.3%
if 2.05e-4 < x Initial program 89.3%
fabs-sub89.3%
associate-*l/83.2%
associate-*r/91.9%
fmm-def93.2%
distribute-neg-frac93.2%
+-commutative93.2%
distribute-neg-in93.2%
unsub-neg93.2%
metadata-eval93.2%
Simplified93.2%
fma-undefine91.9%
associate-*r/83.2%
associate-*l/89.3%
div-inv89.1%
sub-neg89.1%
metadata-eval89.1%
distribute-neg-in89.1%
+-commutative89.1%
cancel-sign-sub-inv89.1%
div-inv89.3%
fabs-sub89.3%
add-sqr-sqrt47.6%
fabs-sqr47.6%
add-sqr-sqrt48.3%
sub-neg48.3%
distribute-rgt-neg-in48.3%
Applied egg-rr48.3%
Taylor expanded in x around inf 48.3%
distribute-rgt-neg-out48.3%
distribute-lft-neg-in48.3%
add-sqr-sqrt16.1%
sqrt-unprod31.4%
sqr-neg31.4%
sqrt-unprod20.2%
add-sqr-sqrt41.7%
cancel-sign-sub-inv41.7%
*-un-lft-identity41.7%
*-commutative41.7%
distribute-rgt-out--49.7%
add-sqr-sqrt28.2%
sqrt-unprod44.7%
sqr-neg44.7%
sqrt-unprod21.4%
add-sqr-sqrt53.6%
Applied egg-rr53.6%
(FPCore (x y z) :precision binary64 (if (<= x -3.4e-11) (* x (/ (+ -1.0 z) y)) (if (<= x 0.000225) (+ (/ x y) (/ 4.0 y)) (* (/ x y) (- 1.0 z)))))
double code(double x, double y, double z) {
double tmp;
if (x <= -3.4e-11) {
tmp = x * ((-1.0 + z) / y);
} else if (x <= 0.000225) {
tmp = (x / y) + (4.0 / y);
} else {
tmp = (x / y) * (1.0 - z);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x <= (-3.4d-11)) then
tmp = x * (((-1.0d0) + z) / y)
else if (x <= 0.000225d0) then
tmp = (x / y) + (4.0d0 / y)
else
tmp = (x / y) * (1.0d0 - z)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -3.4e-11) {
tmp = x * ((-1.0 + z) / y);
} else if (x <= 0.000225) {
tmp = (x / y) + (4.0 / y);
} else {
tmp = (x / y) * (1.0 - z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -3.4e-11: tmp = x * ((-1.0 + z) / y) elif x <= 0.000225: tmp = (x / y) + (4.0 / y) else: tmp = (x / y) * (1.0 - z) return tmp
function code(x, y, z) tmp = 0.0 if (x <= -3.4e-11) tmp = Float64(x * Float64(Float64(-1.0 + z) / y)); elseif (x <= 0.000225) tmp = Float64(Float64(x / y) + Float64(4.0 / y)); else tmp = Float64(Float64(x / y) * Float64(1.0 - z)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -3.4e-11) tmp = x * ((-1.0 + z) / y); elseif (x <= 0.000225) tmp = (x / y) + (4.0 / y); else tmp = (x / y) * (1.0 - z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -3.4e-11], N[(x * N[(N[(-1.0 + z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 0.000225], N[(N[(x / y), $MachinePrecision] + N[(4.0 / y), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] * N[(1.0 - z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.4 \cdot 10^{-11}:\\
\;\;\;\;x \cdot \frac{-1 + z}{y}\\
\mathbf{elif}\;x \leq 0.000225:\\
\;\;\;\;\frac{x}{y} + \frac{4}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} \cdot \left(1 - z\right)\\
\end{array}
\end{array}
if x < -3.3999999999999999e-11Initial program 88.1%
fabs-sub88.1%
associate-*l/81.8%
associate-*r/88.2%
fmm-def91.5%
distribute-neg-frac91.5%
+-commutative91.5%
distribute-neg-in91.5%
unsub-neg91.5%
metadata-eval91.5%
Simplified91.5%
add-sqr-sqrt54.7%
fabs-sqr54.7%
add-sqr-sqrt55.1%
fma-undefine53.4%
associate-*r/47.1%
associate-*l/53.5%
div-inv53.3%
sub-neg53.3%
metadata-eval53.3%
distribute-neg-in53.3%
+-commutative53.3%
cancel-sign-sub-inv53.3%
div-inv53.5%
associate-*l/47.1%
sub-div55.5%
Applied egg-rr55.5%
Taylor expanded in x around inf 55.5%
associate-/l*61.6%
sub-neg61.6%
metadata-eval61.6%
Simplified61.6%
if -3.3999999999999999e-11 < x < 2.2499999999999999e-4Initial program 95.0%
fabs-sub95.0%
associate-*l/99.9%
associate-*r/92.2%
fmm-def92.2%
distribute-neg-frac92.2%
+-commutative92.2%
distribute-neg-in92.2%
unsub-neg92.2%
metadata-eval92.2%
Simplified92.2%
fma-undefine92.2%
associate-*r/99.9%
associate-*l/95.0%
div-inv95.0%
sub-neg95.0%
metadata-eval95.0%
distribute-neg-in95.0%
+-commutative95.0%
cancel-sign-sub-inv95.0%
div-inv95.0%
fabs-sub95.0%
add-sqr-sqrt41.3%
fabs-sqr41.3%
add-sqr-sqrt42.7%
associate-*l/46.5%
sub-div46.5%
Applied egg-rr46.5%
Taylor expanded in z around 0 38.3%
Taylor expanded in x around 0 38.3%
associate-*r/38.3%
metadata-eval38.3%
+-commutative38.3%
Simplified38.3%
if 2.2499999999999999e-4 < x Initial program 89.3%
fabs-sub89.3%
associate-*l/83.2%
associate-*r/91.9%
fmm-def93.2%
distribute-neg-frac93.2%
+-commutative93.2%
distribute-neg-in93.2%
unsub-neg93.2%
metadata-eval93.2%
Simplified93.2%
fma-undefine91.9%
associate-*r/83.2%
associate-*l/89.3%
div-inv89.1%
sub-neg89.1%
metadata-eval89.1%
distribute-neg-in89.1%
+-commutative89.1%
cancel-sign-sub-inv89.1%
div-inv89.3%
fabs-sub89.3%
add-sqr-sqrt47.6%
fabs-sqr47.6%
add-sqr-sqrt48.3%
sub-neg48.3%
distribute-rgt-neg-in48.3%
Applied egg-rr48.3%
Taylor expanded in x around inf 48.3%
distribute-rgt-neg-out48.3%
distribute-lft-neg-in48.3%
add-sqr-sqrt16.1%
sqrt-unprod31.4%
sqr-neg31.4%
sqrt-unprod20.2%
add-sqr-sqrt41.7%
cancel-sign-sub-inv41.7%
*-un-lft-identity41.7%
*-commutative41.7%
distribute-rgt-out--49.7%
add-sqr-sqrt28.2%
sqrt-unprod44.7%
sqr-neg44.7%
sqrt-unprod21.4%
add-sqr-sqrt53.6%
Applied egg-rr53.6%
Final simplification48.3%
(FPCore (x y z) :precision binary64 (if (<= x -3.4e-11) (* x (/ (+ -1.0 z) y)) (if (<= x 0.000185) (/ (+ x 4.0) y) (* (/ x y) (- 1.0 z)))))
double code(double x, double y, double z) {
double tmp;
if (x <= -3.4e-11) {
tmp = x * ((-1.0 + z) / y);
} else if (x <= 0.000185) {
tmp = (x + 4.0) / y;
} else {
tmp = (x / y) * (1.0 - z);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x <= (-3.4d-11)) then
tmp = x * (((-1.0d0) + z) / y)
else if (x <= 0.000185d0) then
tmp = (x + 4.0d0) / y
else
tmp = (x / y) * (1.0d0 - z)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -3.4e-11) {
tmp = x * ((-1.0 + z) / y);
} else if (x <= 0.000185) {
tmp = (x + 4.0) / y;
} else {
tmp = (x / y) * (1.0 - z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -3.4e-11: tmp = x * ((-1.0 + z) / y) elif x <= 0.000185: tmp = (x + 4.0) / y else: tmp = (x / y) * (1.0 - z) return tmp
function code(x, y, z) tmp = 0.0 if (x <= -3.4e-11) tmp = Float64(x * Float64(Float64(-1.0 + z) / y)); elseif (x <= 0.000185) tmp = Float64(Float64(x + 4.0) / y); else tmp = Float64(Float64(x / y) * Float64(1.0 - z)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -3.4e-11) tmp = x * ((-1.0 + z) / y); elseif (x <= 0.000185) tmp = (x + 4.0) / y; else tmp = (x / y) * (1.0 - z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -3.4e-11], N[(x * N[(N[(-1.0 + z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 0.000185], N[(N[(x + 4.0), $MachinePrecision] / y), $MachinePrecision], N[(N[(x / y), $MachinePrecision] * N[(1.0 - z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.4 \cdot 10^{-11}:\\
\;\;\;\;x \cdot \frac{-1 + z}{y}\\
\mathbf{elif}\;x \leq 0.000185:\\
\;\;\;\;\frac{x + 4}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} \cdot \left(1 - z\right)\\
\end{array}
\end{array}
if x < -3.3999999999999999e-11Initial program 88.1%
fabs-sub88.1%
associate-*l/81.8%
associate-*r/88.2%
fmm-def91.5%
distribute-neg-frac91.5%
+-commutative91.5%
distribute-neg-in91.5%
unsub-neg91.5%
metadata-eval91.5%
Simplified91.5%
add-sqr-sqrt54.7%
fabs-sqr54.7%
add-sqr-sqrt55.1%
fma-undefine53.4%
associate-*r/47.1%
associate-*l/53.5%
div-inv53.3%
sub-neg53.3%
metadata-eval53.3%
distribute-neg-in53.3%
+-commutative53.3%
cancel-sign-sub-inv53.3%
div-inv53.5%
associate-*l/47.1%
sub-div55.5%
Applied egg-rr55.5%
Taylor expanded in x around inf 55.5%
associate-/l*61.6%
sub-neg61.6%
metadata-eval61.6%
Simplified61.6%
if -3.3999999999999999e-11 < x < 1.85e-4Initial program 95.0%
fabs-sub95.0%
associate-*l/99.9%
associate-*r/92.2%
fmm-def92.2%
distribute-neg-frac92.2%
+-commutative92.2%
distribute-neg-in92.2%
unsub-neg92.2%
metadata-eval92.2%
Simplified92.2%
fma-undefine92.2%
associate-*r/99.9%
associate-*l/95.0%
div-inv95.0%
sub-neg95.0%
metadata-eval95.0%
distribute-neg-in95.0%
+-commutative95.0%
cancel-sign-sub-inv95.0%
div-inv95.0%
fabs-sub95.0%
add-sqr-sqrt41.3%
fabs-sqr41.3%
add-sqr-sqrt42.7%
associate-*l/46.5%
sub-div46.5%
Applied egg-rr46.5%
Taylor expanded in z around 0 38.3%
if 1.85e-4 < x Initial program 89.3%
fabs-sub89.3%
associate-*l/83.2%
associate-*r/91.9%
fmm-def93.2%
distribute-neg-frac93.2%
+-commutative93.2%
distribute-neg-in93.2%
unsub-neg93.2%
metadata-eval93.2%
Simplified93.2%
fma-undefine91.9%
associate-*r/83.2%
associate-*l/89.3%
div-inv89.1%
sub-neg89.1%
metadata-eval89.1%
distribute-neg-in89.1%
+-commutative89.1%
cancel-sign-sub-inv89.1%
div-inv89.3%
fabs-sub89.3%
add-sqr-sqrt47.6%
fabs-sqr47.6%
add-sqr-sqrt48.3%
sub-neg48.3%
distribute-rgt-neg-in48.3%
Applied egg-rr48.3%
Taylor expanded in x around inf 48.3%
distribute-rgt-neg-out48.3%
distribute-lft-neg-in48.3%
add-sqr-sqrt16.1%
sqrt-unprod31.4%
sqr-neg31.4%
sqrt-unprod20.2%
add-sqr-sqrt41.7%
cancel-sign-sub-inv41.7%
*-un-lft-identity41.7%
*-commutative41.7%
distribute-rgt-out--49.7%
add-sqr-sqrt28.2%
sqrt-unprod44.7%
sqr-neg44.7%
sqrt-unprod21.4%
add-sqr-sqrt53.6%
Applied egg-rr53.6%
Final simplification48.3%
(FPCore (x y z) :precision binary64 (if (<= x -1.55) (* (/ -1.0 y) x) (if (<= x 4.0) (/ 4.0 y) (/ x y))))
double code(double x, double y, double z) {
double tmp;
if (x <= -1.55) {
tmp = (-1.0 / y) * x;
} else if (x <= 4.0) {
tmp = 4.0 / y;
} else {
tmp = x / y;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x <= (-1.55d0)) then
tmp = ((-1.0d0) / y) * x
else if (x <= 4.0d0) then
tmp = 4.0d0 / y
else
tmp = x / y
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -1.55) {
tmp = (-1.0 / y) * x;
} else if (x <= 4.0) {
tmp = 4.0 / y;
} else {
tmp = x / y;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -1.55: tmp = (-1.0 / y) * x elif x <= 4.0: tmp = 4.0 / y else: tmp = x / y return tmp
function code(x, y, z) tmp = 0.0 if (x <= -1.55) tmp = Float64(Float64(-1.0 / y) * x); elseif (x <= 4.0) tmp = Float64(4.0 / y); else tmp = Float64(x / y); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -1.55) tmp = (-1.0 / y) * x; elseif (x <= 4.0) tmp = 4.0 / y; else tmp = x / y; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -1.55], N[(N[(-1.0 / y), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[x, 4.0], N[(4.0 / y), $MachinePrecision], N[(x / y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.55:\\
\;\;\;\;\frac{-1}{y} \cdot x\\
\mathbf{elif}\;x \leq 4:\\
\;\;\;\;\frac{4}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\
\end{array}
\end{array}
if x < -1.55000000000000004Initial program 87.4%
fabs-sub87.4%
associate-*l/80.6%
associate-*r/87.4%
fmm-def90.9%
distribute-neg-frac90.9%
+-commutative90.9%
distribute-neg-in90.9%
unsub-neg90.9%
metadata-eval90.9%
Simplified90.9%
add-sqr-sqrt56.8%
fabs-sqr56.8%
add-sqr-sqrt57.2%
fma-undefine55.4%
associate-*r/48.7%
associate-*l/55.5%
div-inv55.3%
sub-neg55.3%
metadata-eval55.3%
distribute-neg-in55.3%
+-commutative55.3%
cancel-sign-sub-inv55.3%
div-inv55.5%
associate-*l/48.7%
sub-div57.6%
Applied egg-rr57.6%
Taylor expanded in x around inf 57.7%
associate-/l*64.2%
sub-neg64.2%
metadata-eval64.2%
Simplified64.2%
Taylor expanded in z around 0 35.5%
if -1.55000000000000004 < x < 4Initial program 95.2%
fabs-sub95.2%
associate-*l/99.9%
associate-*r/92.5%
fmm-def92.6%
distribute-neg-frac92.6%
+-commutative92.6%
distribute-neg-in92.6%
unsub-neg92.6%
metadata-eval92.6%
Simplified92.6%
fma-undefine92.5%
associate-*r/99.9%
associate-*l/95.2%
div-inv95.2%
sub-neg95.2%
metadata-eval95.2%
distribute-neg-in95.2%
+-commutative95.2%
cancel-sign-sub-inv95.2%
div-inv95.2%
fabs-sub95.2%
add-sqr-sqrt41.7%
fabs-sqr41.7%
add-sqr-sqrt43.0%
associate-*l/46.6%
sub-div46.6%
Applied egg-rr46.6%
Taylor expanded in x around 0 36.7%
if 4 < x Initial program 89.0%
fabs-sub89.0%
associate-*l/82.8%
associate-*r/91.7%
fmm-def93.0%
distribute-neg-frac93.0%
+-commutative93.0%
distribute-neg-in93.0%
unsub-neg93.0%
metadata-eval93.0%
Simplified93.0%
fma-undefine91.7%
associate-*r/82.8%
associate-*l/89.0%
div-inv88.8%
sub-neg88.8%
metadata-eval88.8%
distribute-neg-in88.8%
+-commutative88.8%
cancel-sign-sub-inv88.8%
div-inv89.0%
fabs-sub89.0%
add-sqr-sqrt48.9%
fabs-sqr48.9%
add-sqr-sqrt49.6%
sub-neg49.6%
distribute-rgt-neg-in49.6%
Applied egg-rr49.6%
Taylor expanded in x around inf 49.6%
Taylor expanded in z around 0 37.1%
Final simplification36.6%
(FPCore (x y z) :precision binary64 (if (<= x -3.4e-11) (* x (/ (+ -1.0 z) y)) (/ (+ x 4.0) y)))
double code(double x, double y, double z) {
double tmp;
if (x <= -3.4e-11) {
tmp = x * ((-1.0 + z) / y);
} else {
tmp = (x + 4.0) / y;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x <= (-3.4d-11)) then
tmp = x * (((-1.0d0) + z) / y)
else
tmp = (x + 4.0d0) / y
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -3.4e-11) {
tmp = x * ((-1.0 + z) / y);
} else {
tmp = (x + 4.0) / y;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -3.4e-11: tmp = x * ((-1.0 + z) / y) else: tmp = (x + 4.0) / y return tmp
function code(x, y, z) tmp = 0.0 if (x <= -3.4e-11) tmp = Float64(x * Float64(Float64(-1.0 + z) / y)); else tmp = Float64(Float64(x + 4.0) / y); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -3.4e-11) tmp = x * ((-1.0 + z) / y); else tmp = (x + 4.0) / y; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -3.4e-11], N[(x * N[(N[(-1.0 + z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(N[(x + 4.0), $MachinePrecision] / y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.4 \cdot 10^{-11}:\\
\;\;\;\;x \cdot \frac{-1 + z}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + 4}{y}\\
\end{array}
\end{array}
if x < -3.3999999999999999e-11Initial program 88.1%
fabs-sub88.1%
associate-*l/81.8%
associate-*r/88.2%
fmm-def91.5%
distribute-neg-frac91.5%
+-commutative91.5%
distribute-neg-in91.5%
unsub-neg91.5%
metadata-eval91.5%
Simplified91.5%
add-sqr-sqrt54.7%
fabs-sqr54.7%
add-sqr-sqrt55.1%
fma-undefine53.4%
associate-*r/47.1%
associate-*l/53.5%
div-inv53.3%
sub-neg53.3%
metadata-eval53.3%
distribute-neg-in53.3%
+-commutative53.3%
cancel-sign-sub-inv53.3%
div-inv53.5%
associate-*l/47.1%
sub-div55.5%
Applied egg-rr55.5%
Taylor expanded in x around inf 55.5%
associate-/l*61.6%
sub-neg61.6%
metadata-eval61.6%
Simplified61.6%
if -3.3999999999999999e-11 < x Initial program 92.8%
fabs-sub92.8%
associate-*l/93.5%
associate-*r/92.1%
fmm-def92.6%
distribute-neg-frac92.6%
+-commutative92.6%
distribute-neg-in92.6%
unsub-neg92.6%
metadata-eval92.6%
Simplified92.6%
fma-undefine92.1%
associate-*r/93.5%
associate-*l/92.8%
div-inv92.8%
sub-neg92.8%
metadata-eval92.8%
distribute-neg-in92.8%
+-commutative92.8%
cancel-sign-sub-inv92.8%
div-inv92.8%
fabs-sub92.8%
add-sqr-sqrt43.7%
fabs-sqr43.7%
add-sqr-sqrt44.8%
associate-*l/45.7%
sub-div47.7%
Applied egg-rr47.7%
Taylor expanded in z around 0 37.5%
Final simplification43.2%
(FPCore (x y z) :precision binary64 (if (<= x -4.0) (/ (- -4.0 x) y) (/ (+ x 4.0) y)))
double code(double x, double y, double z) {
double tmp;
if (x <= -4.0) {
tmp = (-4.0 - x) / y;
} else {
tmp = (x + 4.0) / y;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x <= (-4.0d0)) then
tmp = ((-4.0d0) - x) / y
else
tmp = (x + 4.0d0) / y
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -4.0) {
tmp = (-4.0 - x) / y;
} else {
tmp = (x + 4.0) / y;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -4.0: tmp = (-4.0 - x) / y else: tmp = (x + 4.0) / y return tmp
function code(x, y, z) tmp = 0.0 if (x <= -4.0) tmp = Float64(Float64(-4.0 - x) / y); else tmp = Float64(Float64(x + 4.0) / y); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -4.0) tmp = (-4.0 - x) / y; else tmp = (x + 4.0) / y; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -4.0], N[(N[(-4.0 - x), $MachinePrecision] / y), $MachinePrecision], N[(N[(x + 4.0), $MachinePrecision] / y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4:\\
\;\;\;\;\frac{-4 - x}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + 4}{y}\\
\end{array}
\end{array}
if x < -4Initial program 87.4%
fabs-sub87.4%
associate-*l/80.6%
associate-*r/87.4%
fmm-def90.9%
distribute-neg-frac90.9%
+-commutative90.9%
distribute-neg-in90.9%
unsub-neg90.9%
metadata-eval90.9%
Simplified90.9%
add-sqr-sqrt56.8%
fabs-sqr56.8%
add-sqr-sqrt57.2%
fma-undefine55.4%
associate-*r/48.7%
associate-*l/55.5%
div-inv55.3%
sub-neg55.3%
metadata-eval55.3%
distribute-neg-in55.3%
+-commutative55.3%
cancel-sign-sub-inv55.3%
div-inv55.5%
associate-*l/48.7%
sub-div57.6%
Applied egg-rr57.6%
Taylor expanded in z around 0 35.7%
associate-*r/35.7%
distribute-lft-in35.7%
metadata-eval35.7%
neg-mul-135.7%
sub-neg35.7%
Simplified35.7%
if -4 < x Initial program 92.9%
fabs-sub92.9%
associate-*l/93.6%
associate-*r/92.2%
fmm-def92.7%
distribute-neg-frac92.7%
+-commutative92.7%
distribute-neg-in92.7%
unsub-neg92.7%
metadata-eval92.7%
Simplified92.7%
fma-undefine92.2%
associate-*r/93.6%
associate-*l/92.9%
div-inv92.9%
sub-neg92.9%
metadata-eval92.9%
distribute-neg-in92.9%
+-commutative92.9%
cancel-sign-sub-inv92.9%
div-inv92.9%
fabs-sub92.9%
add-sqr-sqrt44.3%
fabs-sqr44.3%
add-sqr-sqrt45.4%
associate-*l/46.3%
sub-div48.3%
Applied egg-rr48.3%
Taylor expanded in z around 0 36.9%
Final simplification36.6%
(FPCore (x y z) :precision binary64 (if (<= x -4.0) (* (/ -1.0 y) x) (/ (+ x 4.0) y)))
double code(double x, double y, double z) {
double tmp;
if (x <= -4.0) {
tmp = (-1.0 / y) * x;
} else {
tmp = (x + 4.0) / y;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x <= (-4.0d0)) then
tmp = ((-1.0d0) / y) * x
else
tmp = (x + 4.0d0) / y
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -4.0) {
tmp = (-1.0 / y) * x;
} else {
tmp = (x + 4.0) / y;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -4.0: tmp = (-1.0 / y) * x else: tmp = (x + 4.0) / y return tmp
function code(x, y, z) tmp = 0.0 if (x <= -4.0) tmp = Float64(Float64(-1.0 / y) * x); else tmp = Float64(Float64(x + 4.0) / y); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -4.0) tmp = (-1.0 / y) * x; else tmp = (x + 4.0) / y; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -4.0], N[(N[(-1.0 / y), $MachinePrecision] * x), $MachinePrecision], N[(N[(x + 4.0), $MachinePrecision] / y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4:\\
\;\;\;\;\frac{-1}{y} \cdot x\\
\mathbf{else}:\\
\;\;\;\;\frac{x + 4}{y}\\
\end{array}
\end{array}
if x < -4Initial program 87.4%
fabs-sub87.4%
associate-*l/80.6%
associate-*r/87.4%
fmm-def90.9%
distribute-neg-frac90.9%
+-commutative90.9%
distribute-neg-in90.9%
unsub-neg90.9%
metadata-eval90.9%
Simplified90.9%
add-sqr-sqrt56.8%
fabs-sqr56.8%
add-sqr-sqrt57.2%
fma-undefine55.4%
associate-*r/48.7%
associate-*l/55.5%
div-inv55.3%
sub-neg55.3%
metadata-eval55.3%
distribute-neg-in55.3%
+-commutative55.3%
cancel-sign-sub-inv55.3%
div-inv55.5%
associate-*l/48.7%
sub-div57.6%
Applied egg-rr57.6%
Taylor expanded in x around inf 57.7%
associate-/l*64.2%
sub-neg64.2%
metadata-eval64.2%
Simplified64.2%
Taylor expanded in z around 0 35.5%
if -4 < x Initial program 92.9%
fabs-sub92.9%
associate-*l/93.6%
associate-*r/92.2%
fmm-def92.7%
distribute-neg-frac92.7%
+-commutative92.7%
distribute-neg-in92.7%
unsub-neg92.7%
metadata-eval92.7%
Simplified92.7%
fma-undefine92.2%
associate-*r/93.6%
associate-*l/92.9%
div-inv92.9%
sub-neg92.9%
metadata-eval92.9%
distribute-neg-in92.9%
+-commutative92.9%
cancel-sign-sub-inv92.9%
div-inv92.9%
fabs-sub92.9%
add-sqr-sqrt44.3%
fabs-sqr44.3%
add-sqr-sqrt45.4%
associate-*l/46.3%
sub-div48.3%
Applied egg-rr48.3%
Taylor expanded in z around 0 36.9%
Final simplification36.6%
(FPCore (x y z) :precision binary64 (if (<= x 4.0) (/ 4.0 y) (/ x y)))
double code(double x, double y, double z) {
double tmp;
if (x <= 4.0) {
tmp = 4.0 / y;
} else {
tmp = x / y;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x <= 4.0d0) then
tmp = 4.0d0 / y
else
tmp = x / y
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= 4.0) {
tmp = 4.0 / y;
} else {
tmp = x / y;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= 4.0: tmp = 4.0 / y else: tmp = x / y return tmp
function code(x, y, z) tmp = 0.0 if (x <= 4.0) tmp = Float64(4.0 / y); else tmp = Float64(x / y); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= 4.0) tmp = 4.0 / y; else tmp = x / y; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 4.0], N[(4.0 / y), $MachinePrecision], N[(x / y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 4:\\
\;\;\;\;\frac{4}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\
\end{array}
\end{array}
if x < 4Initial program 92.8%
fabs-sub92.8%
associate-*l/94.0%
associate-*r/91.0%
fmm-def92.0%
distribute-neg-frac92.0%
+-commutative92.0%
distribute-neg-in92.0%
unsub-neg92.0%
metadata-eval92.0%
Simplified92.0%
fma-undefine91.0%
associate-*r/94.0%
associate-*l/92.8%
div-inv92.8%
sub-neg92.8%
metadata-eval92.8%
distribute-neg-in92.8%
+-commutative92.8%
cancel-sign-sub-inv92.8%
div-inv92.8%
fabs-sub92.8%
add-sqr-sqrt38.7%
fabs-sqr38.7%
add-sqr-sqrt39.8%
associate-*l/42.4%
sub-div43.4%
Applied egg-rr43.4%
Taylor expanded in x around 0 26.5%
if 4 < x Initial program 89.0%
fabs-sub89.0%
associate-*l/82.8%
associate-*r/91.7%
fmm-def93.0%
distribute-neg-frac93.0%
+-commutative93.0%
distribute-neg-in93.0%
unsub-neg93.0%
metadata-eval93.0%
Simplified93.0%
fma-undefine91.7%
associate-*r/82.8%
associate-*l/89.0%
div-inv88.8%
sub-neg88.8%
metadata-eval88.8%
distribute-neg-in88.8%
+-commutative88.8%
cancel-sign-sub-inv88.8%
div-inv89.0%
fabs-sub89.0%
add-sqr-sqrt48.9%
fabs-sqr48.9%
add-sqr-sqrt49.6%
sub-neg49.6%
distribute-rgt-neg-in49.6%
Applied egg-rr49.6%
Taylor expanded in x around inf 49.6%
Taylor expanded in z around 0 37.1%
(FPCore (x y z) :precision binary64 (/ 4.0 y))
double code(double x, double y, double z) {
return 4.0 / y;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = 4.0d0 / y
end function
public static double code(double x, double y, double z) {
return 4.0 / y;
}
def code(x, y, z): return 4.0 / y
function code(x, y, z) return Float64(4.0 / y) end
function tmp = code(x, y, z) tmp = 4.0 / y; end
code[x_, y_, z_] := N[(4.0 / y), $MachinePrecision]
\begin{array}{l}
\\
\frac{4}{y}
\end{array}
Initial program 91.7%
fabs-sub91.7%
associate-*l/90.8%
associate-*r/91.2%
fmm-def92.3%
distribute-neg-frac92.3%
+-commutative92.3%
distribute-neg-in92.3%
unsub-neg92.3%
metadata-eval92.3%
Simplified92.3%
fma-undefine91.2%
associate-*r/90.8%
associate-*l/91.7%
div-inv91.6%
sub-neg91.6%
metadata-eval91.6%
distribute-neg-in91.6%
+-commutative91.6%
cancel-sign-sub-inv91.6%
div-inv91.7%
fabs-sub91.7%
add-sqr-sqrt41.6%
fabs-sqr41.6%
add-sqr-sqrt42.6%
associate-*l/43.3%
sub-div45.6%
Applied egg-rr45.6%
Taylor expanded in x around 0 19.8%
(FPCore (x y z) :precision binary64 (/ -4.0 y))
double code(double x, double y, double z) {
return -4.0 / y;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = (-4.0d0) / y
end function
public static double code(double x, double y, double z) {
return -4.0 / y;
}
def code(x, y, z): return -4.0 / y
function code(x, y, z) return Float64(-4.0 / y) end
function tmp = code(x, y, z) tmp = -4.0 / y; end
code[x_, y_, z_] := N[(-4.0 / y), $MachinePrecision]
\begin{array}{l}
\\
\frac{-4}{y}
\end{array}
Initial program 91.7%
fabs-sub91.7%
associate-*l/90.8%
associate-*r/91.2%
fmm-def92.3%
distribute-neg-frac92.3%
+-commutative92.3%
distribute-neg-in92.3%
unsub-neg92.3%
metadata-eval92.3%
Simplified92.3%
add-sqr-sqrt50.2%
fabs-sqr50.2%
add-sqr-sqrt51.0%
fma-undefine50.2%
associate-*r/48.8%
associate-*l/50.4%
div-inv50.4%
sub-neg50.4%
metadata-eval50.4%
distribute-neg-in50.4%
+-commutative50.4%
cancel-sign-sub-inv50.4%
div-inv50.4%
associate-*l/48.8%
sub-div51.5%
Applied egg-rr51.5%
Taylor expanded in x around 0 22.2%
herbie shell --seed 2024154
(FPCore (x y z)
:name "fabs fraction 1"
:precision binary64
(fabs (- (/ (+ x 4.0) y) (* (/ x y) z))))