
(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 10 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 (if (<= (fabs (- (/ (+ x 4.0) y) (* (/ x y) z))) 1e+29) (fabs (/ (- (+ x 4.0) (* x z)) y)) (fabs (+ (/ 4.0 y) (* (/ x y) (- 1.0 z))))))
double code(double x, double y, double z) {
double tmp;
if (fabs((((x + 4.0) / y) - ((x / y) * z))) <= 1e+29) {
tmp = fabs((((x + 4.0) - (x * z)) / y));
} else {
tmp = fabs(((4.0 / y) + ((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 (abs((((x + 4.0d0) / y) - ((x / y) * z))) <= 1d+29) then
tmp = abs((((x + 4.0d0) - (x * z)) / y))
else
tmp = abs(((4.0d0 / y) + ((x / y) * (1.0d0 - z))))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (Math.abs((((x + 4.0) / y) - ((x / y) * z))) <= 1e+29) {
tmp = Math.abs((((x + 4.0) - (x * z)) / y));
} else {
tmp = Math.abs(((4.0 / y) + ((x / y) * (1.0 - z))));
}
return tmp;
}
def code(x, y, z): tmp = 0 if math.fabs((((x + 4.0) / y) - ((x / y) * z))) <= 1e+29: tmp = math.fabs((((x + 4.0) - (x * z)) / y)) else: tmp = math.fabs(((4.0 / y) + ((x / y) * (1.0 - z)))) return tmp
function code(x, y, z) tmp = 0.0 if (abs(Float64(Float64(Float64(x + 4.0) / y) - Float64(Float64(x / y) * z))) <= 1e+29) tmp = abs(Float64(Float64(Float64(x + 4.0) - Float64(x * z)) / y)); else tmp = abs(Float64(Float64(4.0 / y) + Float64(Float64(x / y) * Float64(1.0 - z)))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (abs((((x + 4.0) / y) - ((x / y) * z))) <= 1e+29) tmp = abs((((x + 4.0) - (x * z)) / y)); else tmp = abs(((4.0 / y) + ((x / y) * (1.0 - z)))); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[N[Abs[N[(N[(N[(x + 4.0), $MachinePrecision] / y), $MachinePrecision] - N[(N[(x / y), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], 1e+29], N[Abs[N[(N[(N[(x + 4.0), $MachinePrecision] - N[(x * z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[(4.0 / y), $MachinePrecision] + N[(N[(x / y), $MachinePrecision] * N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\left|\frac{x + 4}{y} - \frac{x}{y} \cdot z\right| \leq 10^{+29}:\\
\;\;\;\;\left|\frac{\left(x + 4\right) - x \cdot z}{y}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{4}{y} + \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))) < 9.99999999999999914e28Initial program 94.3%
fabs-lowering-fabs.f64N/A
associate-*l/N/A
sub-divN/A
flip3-+N/A
div-invN/A
fmm-defN/A
*-commutativeN/A
/-lowering-/.f64N/A
Applied egg-rr99.9%
if 9.99999999999999914e28 < (fabs.f64 (-.f64 (/.f64 (+.f64 x #s(literal 4 binary64)) y) (*.f64 (/.f64 x y) z))) Initial program 89.0%
fabs-lowering-fabs.f64N/A
sub-negN/A
+-commutativeN/A
neg-sub0N/A
associate-+l-N/A
sub0-negN/A
neg-mul-1N/A
distribute-rgt-out--N/A
*-commutativeN/A
neg-mul-1N/A
associate-*l/N/A
*-commutativeN/A
neg-mul-1N/A
distribute-neg-inN/A
sub-negN/A
div-subN/A
distribute-neg-fracN/A
associate--r-N/A
+-commutativeN/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
sub-negN/A
Simplified99.9%
Final simplification99.9%
(FPCore (x y z)
:precision binary64
(if (<= x -1.9e-14)
(fabs (* (/ x y) z))
(if (<= x 1.22e-48)
(fabs (/ 4.0 y))
(if (<= x 1.4e+96) (fabs (* x (/ z y))) (fabs (/ x y))))))
double code(double x, double y, double z) {
double tmp;
if (x <= -1.9e-14) {
tmp = fabs(((x / y) * z));
} else if (x <= 1.22e-48) {
tmp = fabs((4.0 / y));
} else if (x <= 1.4e+96) {
tmp = fabs((x * (z / y)));
} else {
tmp = fabs((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.9d-14)) then
tmp = abs(((x / y) * z))
else if (x <= 1.22d-48) then
tmp = abs((4.0d0 / y))
else if (x <= 1.4d+96) then
tmp = abs((x * (z / y)))
else
tmp = abs((x / y))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -1.9e-14) {
tmp = Math.abs(((x / y) * z));
} else if (x <= 1.22e-48) {
tmp = Math.abs((4.0 / y));
} else if (x <= 1.4e+96) {
tmp = Math.abs((x * (z / y)));
} else {
tmp = Math.abs((x / y));
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -1.9e-14: tmp = math.fabs(((x / y) * z)) elif x <= 1.22e-48: tmp = math.fabs((4.0 / y)) elif x <= 1.4e+96: tmp = math.fabs((x * (z / y))) else: tmp = math.fabs((x / y)) return tmp
function code(x, y, z) tmp = 0.0 if (x <= -1.9e-14) tmp = abs(Float64(Float64(x / y) * z)); elseif (x <= 1.22e-48) tmp = abs(Float64(4.0 / y)); elseif (x <= 1.4e+96) tmp = abs(Float64(x * Float64(z / y))); else tmp = abs(Float64(x / y)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -1.9e-14) tmp = abs(((x / y) * z)); elseif (x <= 1.22e-48) tmp = abs((4.0 / y)); elseif (x <= 1.4e+96) tmp = abs((x * (z / y))); else tmp = abs((x / y)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -1.9e-14], N[Abs[N[(N[(x / y), $MachinePrecision] * z), $MachinePrecision]], $MachinePrecision], If[LessEqual[x, 1.22e-48], N[Abs[N[(4.0 / y), $MachinePrecision]], $MachinePrecision], If[LessEqual[x, 1.4e+96], N[Abs[N[(x * N[(z / y), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(x / y), $MachinePrecision]], $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.9 \cdot 10^{-14}:\\
\;\;\;\;\left|\frac{x}{y} \cdot z\right|\\
\mathbf{elif}\;x \leq 1.22 \cdot 10^{-48}:\\
\;\;\;\;\left|\frac{4}{y}\right|\\
\mathbf{elif}\;x \leq 1.4 \cdot 10^{+96}:\\
\;\;\;\;\left|x \cdot \frac{z}{y}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{x}{y}\right|\\
\end{array}
\end{array}
if x < -1.9000000000000001e-14Initial program 85.9%
fabs-lowering-fabs.f64N/A
sub-negN/A
+-commutativeN/A
neg-sub0N/A
associate-+l-N/A
sub0-negN/A
neg-mul-1N/A
distribute-rgt-out--N/A
*-commutativeN/A
neg-mul-1N/A
associate-*l/N/A
*-commutativeN/A
neg-mul-1N/A
distribute-neg-inN/A
sub-negN/A
div-subN/A
distribute-neg-fracN/A
associate--r-N/A
+-commutativeN/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
sub-negN/A
Simplified99.8%
Taylor expanded in x around inf
div-subN/A
associate-/l*N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f6488.4%
Simplified88.4%
associate-*r/N/A
*-commutativeN/A
associate-/r/N/A
div-subN/A
clear-numN/A
fabs-subN/A
div-invN/A
clear-numN/A
*-commutativeN/A
fabs-lowering-fabs.f64N/A
*-commutativeN/A
clear-numN/A
div-invN/A
clear-numN/A
sub-divN/A
/-lowering-/.f64N/A
--lowering--.f64N/A
/-lowering-/.f6499.0%
Applied egg-rr99.0%
Taylor expanded in z around inf
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f6462.2%
Simplified62.2%
associate-*r/N/A
associate-*l/N/A
*-lowering-*.f64N/A
/-lowering-/.f6469.3%
Applied egg-rr69.3%
if -1.9000000000000001e-14 < x < 1.21999999999999993e-48Initial program 95.6%
fabs-lowering-fabs.f64N/A
sub-negN/A
+-commutativeN/A
neg-sub0N/A
associate-+l-N/A
sub0-negN/A
neg-mul-1N/A
distribute-rgt-out--N/A
*-commutativeN/A
neg-mul-1N/A
associate-*l/N/A
*-commutativeN/A
neg-mul-1N/A
distribute-neg-inN/A
sub-negN/A
div-subN/A
distribute-neg-fracN/A
associate--r-N/A
+-commutativeN/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
sub-negN/A
Simplified95.6%
Taylor expanded in x around 0
/-lowering-/.f6477.3%
Simplified77.3%
if 1.21999999999999993e-48 < x < 1.4e96Initial program 99.8%
fabs-lowering-fabs.f64N/A
sub-negN/A
+-commutativeN/A
neg-sub0N/A
associate-+l-N/A
sub0-negN/A
neg-mul-1N/A
distribute-rgt-out--N/A
*-commutativeN/A
neg-mul-1N/A
associate-*l/N/A
*-commutativeN/A
neg-mul-1N/A
distribute-neg-inN/A
sub-negN/A
div-subN/A
distribute-neg-fracN/A
associate--r-N/A
+-commutativeN/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
sub-negN/A
Simplified99.9%
Taylor expanded in x around inf
div-subN/A
associate-/l*N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f6488.9%
Simplified88.9%
associate-*r/N/A
*-commutativeN/A
associate-/r/N/A
div-subN/A
clear-numN/A
fabs-subN/A
div-invN/A
clear-numN/A
*-commutativeN/A
fabs-lowering-fabs.f64N/A
*-commutativeN/A
clear-numN/A
div-invN/A
clear-numN/A
sub-divN/A
/-lowering-/.f64N/A
--lowering--.f64N/A
/-lowering-/.f6495.0%
Applied egg-rr95.0%
Taylor expanded in z around inf
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f6466.7%
Simplified66.7%
if 1.4e96 < x Initial program 79.9%
fabs-lowering-fabs.f64N/A
sub-negN/A
+-commutativeN/A
neg-sub0N/A
associate-+l-N/A
sub0-negN/A
neg-mul-1N/A
distribute-rgt-out--N/A
*-commutativeN/A
neg-mul-1N/A
associate-*l/N/A
*-commutativeN/A
neg-mul-1N/A
distribute-neg-inN/A
sub-negN/A
div-subN/A
distribute-neg-fracN/A
associate--r-N/A
+-commutativeN/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
sub-negN/A
Simplified100.0%
Taylor expanded in x around inf
div-subN/A
associate-/l*N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f6495.3%
Simplified95.3%
Taylor expanded in z around 0
/-lowering-/.f6484.9%
Simplified84.9%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (fabs (* x (/ z y)))))
(if (<= x -1.5e-16)
t_0
(if (<= x 6.5e-49)
(fabs (/ 4.0 y))
(if (<= x 2.9e+98) t_0 (fabs (/ x y)))))))
double code(double x, double y, double z) {
double t_0 = fabs((x * (z / y)));
double tmp;
if (x <= -1.5e-16) {
tmp = t_0;
} else if (x <= 6.5e-49) {
tmp = fabs((4.0 / y));
} else if (x <= 2.9e+98) {
tmp = t_0;
} else {
tmp = fabs((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) :: t_0
real(8) :: tmp
t_0 = abs((x * (z / y)))
if (x <= (-1.5d-16)) then
tmp = t_0
else if (x <= 6.5d-49) then
tmp = abs((4.0d0 / y))
else if (x <= 2.9d+98) then
tmp = t_0
else
tmp = abs((x / y))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = Math.abs((x * (z / y)));
double tmp;
if (x <= -1.5e-16) {
tmp = t_0;
} else if (x <= 6.5e-49) {
tmp = Math.abs((4.0 / y));
} else if (x <= 2.9e+98) {
tmp = t_0;
} else {
tmp = Math.abs((x / y));
}
return tmp;
}
def code(x, y, z): t_0 = math.fabs((x * (z / y))) tmp = 0 if x <= -1.5e-16: tmp = t_0 elif x <= 6.5e-49: tmp = math.fabs((4.0 / y)) elif x <= 2.9e+98: tmp = t_0 else: tmp = math.fabs((x / y)) return tmp
function code(x, y, z) t_0 = abs(Float64(x * Float64(z / y))) tmp = 0.0 if (x <= -1.5e-16) tmp = t_0; elseif (x <= 6.5e-49) tmp = abs(Float64(4.0 / y)); elseif (x <= 2.9e+98) tmp = t_0; else tmp = abs(Float64(x / y)); end return tmp end
function tmp_2 = code(x, y, z) t_0 = abs((x * (z / y))); tmp = 0.0; if (x <= -1.5e-16) tmp = t_0; elseif (x <= 6.5e-49) tmp = abs((4.0 / y)); elseif (x <= 2.9e+98) tmp = t_0; else tmp = abs((x / y)); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[Abs[N[(x * N[(z / y), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x, -1.5e-16], t$95$0, If[LessEqual[x, 6.5e-49], N[Abs[N[(4.0 / y), $MachinePrecision]], $MachinePrecision], If[LessEqual[x, 2.9e+98], t$95$0, N[Abs[N[(x / y), $MachinePrecision]], $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left|x \cdot \frac{z}{y}\right|\\
\mathbf{if}\;x \leq -1.5 \cdot 10^{-16}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 6.5 \cdot 10^{-49}:\\
\;\;\;\;\left|\frac{4}{y}\right|\\
\mathbf{elif}\;x \leq 2.9 \cdot 10^{+98}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{x}{y}\right|\\
\end{array}
\end{array}
if x < -1.49999999999999997e-16 or 6.49999999999999968e-49 < x < 2.9000000000000001e98Initial program 89.8%
fabs-lowering-fabs.f64N/A
sub-negN/A
+-commutativeN/A
neg-sub0N/A
associate-+l-N/A
sub0-negN/A
neg-mul-1N/A
distribute-rgt-out--N/A
*-commutativeN/A
neg-mul-1N/A
associate-*l/N/A
*-commutativeN/A
neg-mul-1N/A
distribute-neg-inN/A
sub-negN/A
div-subN/A
distribute-neg-fracN/A
associate--r-N/A
+-commutativeN/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
sub-negN/A
Simplified99.8%
Taylor expanded in x around inf
div-subN/A
associate-/l*N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f6488.6%
Simplified88.6%
associate-*r/N/A
*-commutativeN/A
associate-/r/N/A
div-subN/A
clear-numN/A
fabs-subN/A
div-invN/A
clear-numN/A
*-commutativeN/A
fabs-lowering-fabs.f64N/A
*-commutativeN/A
clear-numN/A
div-invN/A
clear-numN/A
sub-divN/A
/-lowering-/.f64N/A
--lowering--.f64N/A
/-lowering-/.f6497.9%
Applied egg-rr97.9%
Taylor expanded in z around inf
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f6463.5%
Simplified63.5%
if -1.49999999999999997e-16 < x < 6.49999999999999968e-49Initial program 95.6%
fabs-lowering-fabs.f64N/A
sub-negN/A
+-commutativeN/A
neg-sub0N/A
associate-+l-N/A
sub0-negN/A
neg-mul-1N/A
distribute-rgt-out--N/A
*-commutativeN/A
neg-mul-1N/A
associate-*l/N/A
*-commutativeN/A
neg-mul-1N/A
distribute-neg-inN/A
sub-negN/A
div-subN/A
distribute-neg-fracN/A
associate--r-N/A
+-commutativeN/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
sub-negN/A
Simplified95.6%
Taylor expanded in x around 0
/-lowering-/.f6477.3%
Simplified77.3%
if 2.9000000000000001e98 < x Initial program 79.9%
fabs-lowering-fabs.f64N/A
sub-negN/A
+-commutativeN/A
neg-sub0N/A
associate-+l-N/A
sub0-negN/A
neg-mul-1N/A
distribute-rgt-out--N/A
*-commutativeN/A
neg-mul-1N/A
associate-*l/N/A
*-commutativeN/A
neg-mul-1N/A
distribute-neg-inN/A
sub-negN/A
div-subN/A
distribute-neg-fracN/A
associate--r-N/A
+-commutativeN/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
sub-negN/A
Simplified100.0%
Taylor expanded in x around inf
div-subN/A
associate-/l*N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f6495.3%
Simplified95.3%
Taylor expanded in z around 0
/-lowering-/.f6484.9%
Simplified84.9%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (fabs (* (/ x y) (- 1.0 z)))))
(if (<= x -540000000000.0)
t_0
(if (<= x 1.9e-7) (/ (fabs (- 4.0 (* x z))) y) t_0))))
double code(double x, double y, double z) {
double t_0 = fabs(((x / y) * (1.0 - z)));
double tmp;
if (x <= -540000000000.0) {
tmp = t_0;
} else if (x <= 1.9e-7) {
tmp = fabs((4.0 - (x * z))) / y;
} else {
tmp = t_0;
}
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 / y) * (1.0d0 - z)))
if (x <= (-540000000000.0d0)) then
tmp = t_0
else if (x <= 1.9d-7) then
tmp = abs((4.0d0 - (x * z))) / y
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = Math.abs(((x / y) * (1.0 - z)));
double tmp;
if (x <= -540000000000.0) {
tmp = t_0;
} else if (x <= 1.9e-7) {
tmp = Math.abs((4.0 - (x * z))) / y;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = math.fabs(((x / y) * (1.0 - z))) tmp = 0 if x <= -540000000000.0: tmp = t_0 elif x <= 1.9e-7: tmp = math.fabs((4.0 - (x * z))) / y else: tmp = t_0 return tmp
function code(x, y, z) t_0 = abs(Float64(Float64(x / y) * Float64(1.0 - z))) tmp = 0.0 if (x <= -540000000000.0) tmp = t_0; elseif (x <= 1.9e-7) tmp = Float64(abs(Float64(4.0 - Float64(x * z))) / y); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = abs(((x / y) * (1.0 - z))); tmp = 0.0; if (x <= -540000000000.0) tmp = t_0; elseif (x <= 1.9e-7) tmp = abs((4.0 - (x * z))) / y; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[Abs[N[(N[(x / y), $MachinePrecision] * N[(1.0 - z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x, -540000000000.0], t$95$0, If[LessEqual[x, 1.9e-7], N[(N[Abs[N[(4.0 - N[(x * z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / y), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left|\frac{x}{y} \cdot \left(1 - z\right)\right|\\
\mathbf{if}\;x \leq -540000000000:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 1.9 \cdot 10^{-7}:\\
\;\;\;\;\frac{\left|4 - x \cdot z\right|}{y}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -5.4e11 or 1.90000000000000007e-7 < x Initial program 86.4%
fabs-lowering-fabs.f64N/A
sub-negN/A
+-commutativeN/A
neg-sub0N/A
associate-+l-N/A
sub0-negN/A
neg-mul-1N/A
distribute-rgt-out--N/A
*-commutativeN/A
neg-mul-1N/A
associate-*l/N/A
*-commutativeN/A
neg-mul-1N/A
distribute-neg-inN/A
sub-negN/A
div-subN/A
distribute-neg-fracN/A
associate--r-N/A
+-commutativeN/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
sub-negN/A
Simplified99.9%
Taylor expanded in x around inf
div-subN/A
associate-/l*N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f6490.4%
Simplified90.4%
*-commutativeN/A
associate-*r/N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f6499.1%
Applied egg-rr99.1%
if -5.4e11 < x < 1.90000000000000007e-7Initial program 95.9%
Taylor expanded in x around 0
/-lowering-/.f6495.9%
Simplified95.9%
associate-*l/N/A
sub-divN/A
fabs-divN/A
remove-double-divN/A
fabs-divN/A
metadata-evalN/A
inv-powN/A
sqr-powN/A
fabs-sqrN/A
sqr-powN/A
inv-powN/A
remove-double-divN/A
/-lowering-/.f64N/A
fabs-lowering-fabs.f64N/A
--lowering--.f64N/A
*-lowering-*.f6441.1%
Applied egg-rr41.1%
(FPCore (x y z) :precision binary64 (let* ((t_0 (fabs (* (/ x y) (- 1.0 z))))) (if (<= x -1.85e-29) t_0 (if (<= x 1.65e-50) (fabs (/ 4.0 y)) t_0))))
double code(double x, double y, double z) {
double t_0 = fabs(((x / y) * (1.0 - z)));
double tmp;
if (x <= -1.85e-29) {
tmp = t_0;
} else if (x <= 1.65e-50) {
tmp = fabs((4.0 / y));
} else {
tmp = t_0;
}
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 / y) * (1.0d0 - z)))
if (x <= (-1.85d-29)) then
tmp = t_0
else if (x <= 1.65d-50) then
tmp = abs((4.0d0 / y))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = Math.abs(((x / y) * (1.0 - z)));
double tmp;
if (x <= -1.85e-29) {
tmp = t_0;
} else if (x <= 1.65e-50) {
tmp = Math.abs((4.0 / y));
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = math.fabs(((x / y) * (1.0 - z))) tmp = 0 if x <= -1.85e-29: tmp = t_0 elif x <= 1.65e-50: tmp = math.fabs((4.0 / y)) else: tmp = t_0 return tmp
function code(x, y, z) t_0 = abs(Float64(Float64(x / y) * Float64(1.0 - z))) tmp = 0.0 if (x <= -1.85e-29) tmp = t_0; elseif (x <= 1.65e-50) tmp = abs(Float64(4.0 / y)); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = abs(((x / y) * (1.0 - z))); tmp = 0.0; if (x <= -1.85e-29) tmp = t_0; elseif (x <= 1.65e-50) tmp = abs((4.0 / y)); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[Abs[N[(N[(x / y), $MachinePrecision] * N[(1.0 - z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x, -1.85e-29], t$95$0, If[LessEqual[x, 1.65e-50], N[Abs[N[(4.0 / y), $MachinePrecision]], $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left|\frac{x}{y} \cdot \left(1 - z\right)\right|\\
\mathbf{if}\;x \leq -1.85 \cdot 10^{-29}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 1.65 \cdot 10^{-50}:\\
\;\;\;\;\left|\frac{4}{y}\right|\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -1.8499999999999999e-29 or 1.6499999999999999e-50 < x Initial program 87.3%
fabs-lowering-fabs.f64N/A
sub-negN/A
+-commutativeN/A
neg-sub0N/A
associate-+l-N/A
sub0-negN/A
neg-mul-1N/A
distribute-rgt-out--N/A
*-commutativeN/A
neg-mul-1N/A
associate-*l/N/A
*-commutativeN/A
neg-mul-1N/A
distribute-neg-inN/A
sub-negN/A
div-subN/A
distribute-neg-fracN/A
associate--r-N/A
+-commutativeN/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
sub-negN/A
Simplified99.8%
Taylor expanded in x around inf
div-subN/A
associate-/l*N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f6489.9%
Simplified89.9%
*-commutativeN/A
associate-*r/N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f6497.9%
Applied egg-rr97.9%
if -1.8499999999999999e-29 < x < 1.6499999999999999e-50Initial program 95.6%
fabs-lowering-fabs.f64N/A
sub-negN/A
+-commutativeN/A
neg-sub0N/A
associate-+l-N/A
sub0-negN/A
neg-mul-1N/A
distribute-rgt-out--N/A
*-commutativeN/A
neg-mul-1N/A
associate-*l/N/A
*-commutativeN/A
neg-mul-1N/A
distribute-neg-inN/A
sub-negN/A
div-subN/A
distribute-neg-fracN/A
associate--r-N/A
+-commutativeN/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
sub-negN/A
Simplified95.6%
Taylor expanded in x around 0
/-lowering-/.f6477.8%
Simplified77.8%
(FPCore (x y z) :precision binary64 (if (<= y 8e+99) (fabs (/ (- (+ x 4.0) (* x z)) y)) (fabs (+ (/ 4.0 y) (* x (/ (- 1.0 z) y))))))
double code(double x, double y, double z) {
double tmp;
if (y <= 8e+99) {
tmp = fabs((((x + 4.0) - (x * z)) / y));
} else {
tmp = fabs(((4.0 / y) + (x * ((1.0 - z) / 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 (y <= 8d+99) then
tmp = abs((((x + 4.0d0) - (x * z)) / y))
else
tmp = abs(((4.0d0 / y) + (x * ((1.0d0 - z) / y))))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= 8e+99) {
tmp = Math.abs((((x + 4.0) - (x * z)) / y));
} else {
tmp = Math.abs(((4.0 / y) + (x * ((1.0 - z) / y))));
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= 8e+99: tmp = math.fabs((((x + 4.0) - (x * z)) / y)) else: tmp = math.fabs(((4.0 / y) + (x * ((1.0 - z) / y)))) return tmp
function code(x, y, z) tmp = 0.0 if (y <= 8e+99) tmp = abs(Float64(Float64(Float64(x + 4.0) - Float64(x * z)) / y)); else tmp = abs(Float64(Float64(4.0 / y) + Float64(x * Float64(Float64(1.0 - z) / y)))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= 8e+99) tmp = abs((((x + 4.0) - (x * z)) / y)); else tmp = abs(((4.0 / y) + (x * ((1.0 - z) / y)))); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, 8e+99], N[Abs[N[(N[(N[(x + 4.0), $MachinePrecision] - N[(x * z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[(4.0 / y), $MachinePrecision] + N[(x * N[(N[(1.0 - z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 8 \cdot 10^{+99}:\\
\;\;\;\;\left|\frac{\left(x + 4\right) - x \cdot z}{y}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{4}{y} + x \cdot \frac{1 - z}{y}\right|\\
\end{array}
\end{array}
if y < 7.9999999999999997e99Initial program 89.7%
fabs-lowering-fabs.f64N/A
associate-*l/N/A
sub-divN/A
flip3-+N/A
div-invN/A
fmm-defN/A
*-commutativeN/A
/-lowering-/.f64N/A
Applied egg-rr98.1%
if 7.9999999999999997e99 < y Initial program 95.4%
fabs-lowering-fabs.f64N/A
sub-negN/A
+-commutativeN/A
neg-sub0N/A
associate-+l-N/A
sub0-negN/A
neg-mul-1N/A
distribute-rgt-out--N/A
*-commutativeN/A
neg-mul-1N/A
associate-*l/N/A
*-commutativeN/A
neg-mul-1N/A
distribute-neg-inN/A
sub-negN/A
div-subN/A
distribute-neg-fracN/A
associate--r-N/A
+-commutativeN/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
sub-negN/A
Simplified95.5%
associate-*l/N/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f6499.7%
Applied egg-rr99.7%
Final simplification98.4%
(FPCore (x y z) :precision binary64 (if (<= z -5e+17) (fabs (/ x (/ y z))) (if (<= z 5.5e+93) (fabs (/ (+ x 4.0) y)) (fabs (/ z (/ y x))))))
double code(double x, double y, double z) {
double tmp;
if (z <= -5e+17) {
tmp = fabs((x / (y / z)));
} else if (z <= 5.5e+93) {
tmp = fabs(((x + 4.0) / y));
} else {
tmp = fabs((z / (y / x)));
}
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 (z <= (-5d+17)) then
tmp = abs((x / (y / z)))
else if (z <= 5.5d+93) then
tmp = abs(((x + 4.0d0) / y))
else
tmp = abs((z / (y / x)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -5e+17) {
tmp = Math.abs((x / (y / z)));
} else if (z <= 5.5e+93) {
tmp = Math.abs(((x + 4.0) / y));
} else {
tmp = Math.abs((z / (y / x)));
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -5e+17: tmp = math.fabs((x / (y / z))) elif z <= 5.5e+93: tmp = math.fabs(((x + 4.0) / y)) else: tmp = math.fabs((z / (y / x))) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -5e+17) tmp = abs(Float64(x / Float64(y / z))); elseif (z <= 5.5e+93) tmp = abs(Float64(Float64(x + 4.0) / y)); else tmp = abs(Float64(z / Float64(y / x))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -5e+17) tmp = abs((x / (y / z))); elseif (z <= 5.5e+93) tmp = abs(((x + 4.0) / y)); else tmp = abs((z / (y / x))); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -5e+17], N[Abs[N[(x / N[(y / z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[z, 5.5e+93], N[Abs[N[(N[(x + 4.0), $MachinePrecision] / y), $MachinePrecision]], $MachinePrecision], N[Abs[N[(z / N[(y / x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5 \cdot 10^{+17}:\\
\;\;\;\;\left|\frac{x}{\frac{y}{z}}\right|\\
\mathbf{elif}\;z \leq 5.5 \cdot 10^{+93}:\\
\;\;\;\;\left|\frac{x + 4}{y}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{z}{\frac{y}{x}}\right|\\
\end{array}
\end{array}
if z < -5e17Initial program 96.1%
fabs-lowering-fabs.f64N/A
sub-negN/A
+-commutativeN/A
neg-sub0N/A
associate-+l-N/A
sub0-negN/A
neg-mul-1N/A
distribute-rgt-out--N/A
*-commutativeN/A
neg-mul-1N/A
associate-*l/N/A
*-commutativeN/A
neg-mul-1N/A
distribute-neg-inN/A
sub-negN/A
div-subN/A
distribute-neg-fracN/A
associate--r-N/A
+-commutativeN/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
sub-negN/A
Simplified96.1%
Taylor expanded in x around inf
div-subN/A
associate-/l*N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f6468.5%
Simplified68.5%
associate-*r/N/A
*-commutativeN/A
associate-/r/N/A
div-subN/A
clear-numN/A
fabs-subN/A
div-invN/A
clear-numN/A
*-commutativeN/A
fabs-lowering-fabs.f64N/A
*-commutativeN/A
clear-numN/A
div-invN/A
clear-numN/A
sub-divN/A
/-lowering-/.f64N/A
--lowering--.f64N/A
/-lowering-/.f6477.6%
Applied egg-rr77.6%
Taylor expanded in z around inf
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f6477.7%
Simplified77.7%
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f6479.4%
Applied egg-rr79.4%
if -5e17 < z < 5.5000000000000003e93Initial program 92.6%
fabs-lowering-fabs.f64N/A
sub-negN/A
+-commutativeN/A
neg-sub0N/A
associate-+l-N/A
sub0-negN/A
neg-mul-1N/A
distribute-rgt-out--N/A
*-commutativeN/A
neg-mul-1N/A
associate-*l/N/A
*-commutativeN/A
neg-mul-1N/A
distribute-neg-inN/A
sub-negN/A
div-subN/A
distribute-neg-fracN/A
associate--r-N/A
+-commutativeN/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
sub-negN/A
Simplified100.0%
Taylor expanded in z around 0
*-rgt-identityN/A
associate-*r/N/A
distribute-rgt-outN/A
associate-*l/N/A
metadata-evalN/A
distribute-lft-neg-inN/A
distribute-frac-negN/A
mul-1-negN/A
distribute-frac-negN/A
remove-double-negN/A
/-lowering-/.f64N/A
+-lowering-+.f6491.1%
Simplified91.1%
if 5.5000000000000003e93 < z Initial program 80.3%
fabs-lowering-fabs.f64N/A
sub-negN/A
+-commutativeN/A
neg-sub0N/A
associate-+l-N/A
sub0-negN/A
neg-mul-1N/A
distribute-rgt-out--N/A
*-commutativeN/A
neg-mul-1N/A
associate-*l/N/A
*-commutativeN/A
neg-mul-1N/A
distribute-neg-inN/A
sub-negN/A
div-subN/A
distribute-neg-fracN/A
associate--r-N/A
+-commutativeN/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
sub-negN/A
Simplified94.9%
Taylor expanded in x around inf
div-subN/A
associate-/l*N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f6476.4%
Simplified76.4%
associate-*r/N/A
*-commutativeN/A
associate-/r/N/A
div-subN/A
clear-numN/A
fabs-subN/A
div-invN/A
clear-numN/A
*-commutativeN/A
fabs-lowering-fabs.f64N/A
*-commutativeN/A
clear-numN/A
div-invN/A
clear-numN/A
sub-divN/A
/-lowering-/.f64N/A
--lowering--.f64N/A
/-lowering-/.f6482.8%
Applied egg-rr82.8%
Taylor expanded in z around inf
Simplified82.8%
Final simplification87.0%
(FPCore (x y z) :precision binary64 (if (<= x -2e+84) (fabs (* (/ x y) (- 1.0 z))) (fabs (/ (- (+ x 4.0) (* x z)) y))))
double code(double x, double y, double z) {
double tmp;
if (x <= -2e+84) {
tmp = fabs(((x / y) * (1.0 - z)));
} else {
tmp = fabs((((x + 4.0) - (x * z)) / 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 <= (-2d+84)) then
tmp = abs(((x / y) * (1.0d0 - z)))
else
tmp = abs((((x + 4.0d0) - (x * z)) / y))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -2e+84) {
tmp = Math.abs(((x / y) * (1.0 - z)));
} else {
tmp = Math.abs((((x + 4.0) - (x * z)) / y));
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -2e+84: tmp = math.fabs(((x / y) * (1.0 - z))) else: tmp = math.fabs((((x + 4.0) - (x * z)) / y)) return tmp
function code(x, y, z) tmp = 0.0 if (x <= -2e+84) tmp = abs(Float64(Float64(x / y) * Float64(1.0 - z))); else tmp = abs(Float64(Float64(Float64(x + 4.0) - Float64(x * z)) / y)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -2e+84) tmp = abs(((x / y) * (1.0 - z))); else tmp = abs((((x + 4.0) - (x * z)) / y)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -2e+84], N[Abs[N[(N[(x / y), $MachinePrecision] * N[(1.0 - z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[(N[(x + 4.0), $MachinePrecision] - N[(x * z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2 \cdot 10^{+84}:\\
\;\;\;\;\left|\frac{x}{y} \cdot \left(1 - z\right)\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{\left(x + 4\right) - x \cdot z}{y}\right|\\
\end{array}
\end{array}
if x < -2.00000000000000012e84Initial program 81.6%
fabs-lowering-fabs.f64N/A
sub-negN/A
+-commutativeN/A
neg-sub0N/A
associate-+l-N/A
sub0-negN/A
neg-mul-1N/A
distribute-rgt-out--N/A
*-commutativeN/A
neg-mul-1N/A
associate-*l/N/A
*-commutativeN/A
neg-mul-1N/A
distribute-neg-inN/A
sub-negN/A
div-subN/A
distribute-neg-fracN/A
associate--r-N/A
+-commutativeN/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
sub-negN/A
Simplified99.8%
Taylor expanded in x around inf
div-subN/A
associate-/l*N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f6484.4%
Simplified84.4%
*-commutativeN/A
associate-*r/N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f6499.8%
Applied egg-rr99.8%
if -2.00000000000000012e84 < x Initial program 93.1%
fabs-lowering-fabs.f64N/A
associate-*l/N/A
sub-divN/A
flip3-+N/A
div-invN/A
fmm-defN/A
*-commutativeN/A
/-lowering-/.f64N/A
Applied egg-rr98.0%
Final simplification98.4%
(FPCore (x y z) :precision binary64 (let* ((t_0 (fabs (/ x y)))) (if (<= x -10.5) t_0 (if (<= x 4.0) (fabs (/ 4.0 y)) t_0))))
double code(double x, double y, double z) {
double t_0 = fabs((x / y));
double tmp;
if (x <= -10.5) {
tmp = t_0;
} else if (x <= 4.0) {
tmp = fabs((4.0 / y));
} else {
tmp = t_0;
}
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 / y))
if (x <= (-10.5d0)) then
tmp = t_0
else if (x <= 4.0d0) then
tmp = abs((4.0d0 / y))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = Math.abs((x / y));
double tmp;
if (x <= -10.5) {
tmp = t_0;
} else if (x <= 4.0) {
tmp = Math.abs((4.0 / y));
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = math.fabs((x / y)) tmp = 0 if x <= -10.5: tmp = t_0 elif x <= 4.0: tmp = math.fabs((4.0 / y)) else: tmp = t_0 return tmp
function code(x, y, z) t_0 = abs(Float64(x / y)) tmp = 0.0 if (x <= -10.5) tmp = t_0; elseif (x <= 4.0) tmp = abs(Float64(4.0 / y)); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = abs((x / y)); tmp = 0.0; if (x <= -10.5) tmp = t_0; elseif (x <= 4.0) tmp = abs((4.0 / y)); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[Abs[N[(x / y), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x, -10.5], t$95$0, If[LessEqual[x, 4.0], N[Abs[N[(4.0 / y), $MachinePrecision]], $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left|\frac{x}{y}\right|\\
\mathbf{if}\;x \leq -10.5:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 4:\\
\;\;\;\;\left|\frac{4}{y}\right|\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -10.5 or 4 < x Initial program 86.4%
fabs-lowering-fabs.f64N/A
sub-negN/A
+-commutativeN/A
neg-sub0N/A
associate-+l-N/A
sub0-negN/A
neg-mul-1N/A
distribute-rgt-out--N/A
*-commutativeN/A
neg-mul-1N/A
associate-*l/N/A
*-commutativeN/A
neg-mul-1N/A
distribute-neg-inN/A
sub-negN/A
div-subN/A
distribute-neg-fracN/A
associate--r-N/A
+-commutativeN/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
sub-negN/A
Simplified99.8%
Taylor expanded in x around inf
div-subN/A
associate-/l*N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f6490.5%
Simplified90.5%
Taylor expanded in z around 0
/-lowering-/.f6461.1%
Simplified61.1%
if -10.5 < x < 4Initial program 95.9%
fabs-lowering-fabs.f64N/A
sub-negN/A
+-commutativeN/A
neg-sub0N/A
associate-+l-N/A
sub0-negN/A
neg-mul-1N/A
distribute-rgt-out--N/A
*-commutativeN/A
neg-mul-1N/A
associate-*l/N/A
*-commutativeN/A
neg-mul-1N/A
distribute-neg-inN/A
sub-negN/A
div-subN/A
distribute-neg-fracN/A
associate--r-N/A
+-commutativeN/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
sub-negN/A
Simplified95.9%
Taylor expanded in x around 0
/-lowering-/.f6473.1%
Simplified73.1%
(FPCore (x y z) :precision binary64 (fabs (/ 4.0 y)))
double code(double x, double y, double z) {
return fabs((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 = abs((4.0d0 / y))
end function
public static double code(double x, double y, double z) {
return Math.abs((4.0 / y));
}
def code(x, y, z): return math.fabs((4.0 / y))
function code(x, y, z) return abs(Float64(4.0 / y)) end
function tmp = code(x, y, z) tmp = abs((4.0 / y)); end
code[x_, y_, z_] := N[Abs[N[(4.0 / y), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|\frac{4}{y}\right|
\end{array}
Initial program 90.7%
fabs-lowering-fabs.f64N/A
sub-negN/A
+-commutativeN/A
neg-sub0N/A
associate-+l-N/A
sub0-negN/A
neg-mul-1N/A
distribute-rgt-out--N/A
*-commutativeN/A
neg-mul-1N/A
associate-*l/N/A
*-commutativeN/A
neg-mul-1N/A
distribute-neg-inN/A
sub-negN/A
div-subN/A
distribute-neg-fracN/A
associate--r-N/A
+-commutativeN/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
sub-negN/A
Simplified98.1%
Taylor expanded in x around 0
/-lowering-/.f6435.4%
Simplified35.4%
herbie shell --seed 2024163
(FPCore (x y z)
:name "fabs fraction 1"
:precision binary64
(fabs (- (/ (+ x 4.0) y) (* (/ x y) z))))