
(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 12 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))) 5e+27) (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))) <= 5e+27) {
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))) <= 5d+27) 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))) <= 5e+27) {
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))) <= 5e+27: 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))) <= 5e+27) 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))) <= 5e+27) 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], 5e+27], 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 5 \cdot 10^{+27}:\\
\;\;\;\;\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))) < 4.99999999999999979e27Initial program 94.4%
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 4.99999999999999979e27 < (fabs.f64 (-.f64 (/.f64 (+.f64 x #s(literal 4 binary64)) y) (*.f64 (/.f64 x y) z))) Initial program 90.5%
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
(let* ((t_0 (fabs (* (/ x y) (- 1.0 z)))))
(if (<= x -1.56)
t_0
(if (<= x 2.95e-18) (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 <= -1.56) {
tmp = t_0;
} else if (x <= 2.95e-18) {
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 <= (-1.56d0)) then
tmp = t_0
else if (x <= 2.95d-18) 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 <= -1.56) {
tmp = t_0;
} else if (x <= 2.95e-18) {
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 <= -1.56: tmp = t_0 elif x <= 2.95e-18: 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 <= -1.56) tmp = t_0; elseif (x <= 2.95e-18) tmp = abs(Float64(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 <= -1.56) tmp = t_0; elseif (x <= 2.95e-18) 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, -1.56], t$95$0, If[LessEqual[x, 2.95e-18], N[Abs[N[(N[(4.0 - N[(x * z), $MachinePrecision]), $MachinePrecision] / 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.56:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 2.95 \cdot 10^{-18}:\\
\;\;\;\;\left|\frac{4 - x \cdot z}{y}\right|\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -1.5600000000000001 or 2.9500000000000001e-18 < x Initial program 88.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
Simplified99.9%
Taylor expanded in x around inf
div-subN/A
associate-/l*N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f6492.4%
Simplified92.4%
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
/-lowering-/.f6498.6%
Applied egg-rr98.6%
if -1.5600000000000001 < x < 2.9500000000000001e-18Initial program 96.0%
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-rr100.0%
Taylor expanded in x around 0
Simplified100.0%
Final simplification99.2%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (fabs (* (/ x y) (- 1.0 z)))))
(if (<= x -1.7e-37)
t_0
(if (<= x 1.2e-26) (/ 1.0 (/ 1.0 (/ (+ 4.0 (- x (* 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 <= -1.7e-37) {
tmp = t_0;
} else if (x <= 1.2e-26) {
tmp = 1.0 / (1.0 / ((4.0 + (x - (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 <= (-1.7d-37)) then
tmp = t_0
else if (x <= 1.2d-26) then
tmp = 1.0d0 / (1.0d0 / ((4.0d0 + (x - (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 <= -1.7e-37) {
tmp = t_0;
} else if (x <= 1.2e-26) {
tmp = 1.0 / (1.0 / ((4.0 + (x - (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 <= -1.7e-37: tmp = t_0 elif x <= 1.2e-26: tmp = 1.0 / (1.0 / ((4.0 + (x - (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 <= -1.7e-37) tmp = t_0; elseif (x <= 1.2e-26) tmp = Float64(1.0 / Float64(1.0 / Float64(Float64(4.0 + Float64(x - 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 <= -1.7e-37) tmp = t_0; elseif (x <= 1.2e-26) tmp = 1.0 / (1.0 / ((4.0 + (x - (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, -1.7e-37], t$95$0, If[LessEqual[x, 1.2e-26], N[(1.0 / N[(1.0 / N[(N[(4.0 + N[(x - N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $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.7 \cdot 10^{-37}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 1.2 \cdot 10^{-26}:\\
\;\;\;\;\frac{1}{\frac{1}{\frac{4 + \left(x - x \cdot z\right)}{y}}}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -1.70000000000000009e-37 or 1.2e-26 < x Initial program 88.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--.f6491.1%
Simplified91.1%
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
/-lowering-/.f6497.0%
Applied egg-rr97.0%
if -1.70000000000000009e-37 < x < 1.2e-26Initial program 95.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-rr100.0%
fabs-divN/A
clear-numN/A
/-lowering-/.f64N/A
div-fabsN/A
fabs-lowering-fabs.f64N/A
/-lowering-/.f64N/A
associate--l+N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
*-lowering-*.f6499.9%
Applied egg-rr99.9%
clear-numN/A
associate-+r-N/A
div-subN/A
associate-/l*N/A
*-commutativeN/A
associate-/r/N/A
*-lft-identityN/A
inv-powN/A
sqr-powN/A
fabs-sqrN/A
sqr-powN/A
inv-powN/A
/-lowering-/.f64N/A
*-lft-identityN/A
associate-/r/N/A
associate-*l/N/A
*-commutativeN/A
Applied egg-rr50.1%
Final simplification76.5%
(FPCore (x y z) :precision binary64 (let* ((t_0 (/ (- 4.0 (* x z)) y))) (if (<= z -8.4e+15) t_0 (if (<= z 6.3e+28) (fabs (/ (+ x 4.0) y)) t_0))))
double code(double x, double y, double z) {
double t_0 = (4.0 - (x * z)) / y;
double tmp;
if (z <= -8.4e+15) {
tmp = t_0;
} else if (z <= 6.3e+28) {
tmp = fabs(((x + 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 = (4.0d0 - (x * z)) / y
if (z <= (-8.4d+15)) then
tmp = t_0
else if (z <= 6.3d+28) then
tmp = abs(((x + 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 = (4.0 - (x * z)) / y;
double tmp;
if (z <= -8.4e+15) {
tmp = t_0;
} else if (z <= 6.3e+28) {
tmp = Math.abs(((x + 4.0) / y));
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = (4.0 - (x * z)) / y tmp = 0 if z <= -8.4e+15: tmp = t_0 elif z <= 6.3e+28: tmp = math.fabs(((x + 4.0) / y)) else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(Float64(4.0 - Float64(x * z)) / y) tmp = 0.0 if (z <= -8.4e+15) tmp = t_0; elseif (z <= 6.3e+28) tmp = abs(Float64(Float64(x + 4.0) / y)); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = (4.0 - (x * z)) / y; tmp = 0.0; if (z <= -8.4e+15) tmp = t_0; elseif (z <= 6.3e+28) tmp = abs(((x + 4.0) / y)); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(4.0 - N[(x * z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]}, If[LessEqual[z, -8.4e+15], t$95$0, If[LessEqual[z, 6.3e+28], N[Abs[N[(N[(x + 4.0), $MachinePrecision] / y), $MachinePrecision]], $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{4 - x \cdot z}{y}\\
\mathbf{if}\;z \leq -8.4 \cdot 10^{+15}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 6.3 \cdot 10^{+28}:\\
\;\;\;\;\left|\frac{x + 4}{y}\right|\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -8.4e15 or 6.3000000000000001e28 < z Initial program 91.8%
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-rr92.1%
fabs-divN/A
clear-numN/A
/-lowering-/.f64N/A
div-fabsN/A
fabs-lowering-fabs.f64N/A
/-lowering-/.f64N/A
associate--l+N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
*-lowering-*.f6492.0%
Applied egg-rr92.0%
clear-numN/A
associate-+r-N/A
div-subN/A
associate-/l*N/A
*-commutativeN/A
associate-/r/N/A
*-lft-identityN/A
inv-powN/A
sqr-powN/A
fabs-sqrN/A
sqr-powN/A
inv-powN/A
clear-numN/A
/-rgt-identityN/A
Applied egg-rr39.3%
Taylor expanded in z around inf
mul-1-negN/A
neg-sub0N/A
--lowering--.f64N/A
*-lowering-*.f6439.3%
Simplified39.3%
if -8.4e15 < z < 6.3000000000000001e28Initial program 91.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 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-+.f6494.4%
Simplified94.4%
Final simplification70.9%
(FPCore (x y z) :precision binary64 (if (<= x 1.3e+16) (fabs (/ (- (+ x 4.0) (* x z)) y)) (fabs (* (/ x y) (- 1.0 z)))))
double code(double x, double y, double z) {
double tmp;
if (x <= 1.3e+16) {
tmp = fabs((((x + 4.0) - (x * z)) / y));
} 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) :: tmp
if (x <= 1.3d+16) then
tmp = abs((((x + 4.0d0) - (x * z)) / y))
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 tmp;
if (x <= 1.3e+16) {
tmp = Math.abs((((x + 4.0) - (x * z)) / y));
} else {
tmp = Math.abs(((x / y) * (1.0 - z)));
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= 1.3e+16: tmp = math.fabs((((x + 4.0) - (x * z)) / y)) else: tmp = math.fabs(((x / y) * (1.0 - z))) return tmp
function code(x, y, z) tmp = 0.0 if (x <= 1.3e+16) tmp = abs(Float64(Float64(Float64(x + 4.0) - Float64(x * z)) / y)); else tmp = abs(Float64(Float64(x / y) * Float64(1.0 - z))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= 1.3e+16) tmp = abs((((x + 4.0) - (x * z)) / y)); else tmp = abs(((x / y) * (1.0 - z))); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 1.3e+16], N[Abs[N[(N[(N[(x + 4.0), $MachinePrecision] - N[(x * z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[(x / y), $MachinePrecision] * N[(1.0 - z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1.3 \cdot 10^{+16}:\\
\;\;\;\;\left|\frac{\left(x + 4\right) - x \cdot z}{y}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{x}{y} \cdot \left(1 - z\right)\right|\\
\end{array}
\end{array}
if x < 1.3e16Initial program 93.8%
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%
if 1.3e16 < x Initial program 86.2%
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--.f6492.7%
Simplified92.7%
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
/-lowering-/.f6499.8%
Applied egg-rr99.8%
Final simplification98.5%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (fabs (/ x y))))
(if (<= x -6.6e-18)
t_0
(if (<= x 3e+155) (/ (+ 4.0 (- x (* x z))) y) t_0))))
double code(double x, double y, double z) {
double t_0 = fabs((x / y));
double tmp;
if (x <= -6.6e-18) {
tmp = t_0;
} else if (x <= 3e+155) {
tmp = (4.0 + (x - (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))
if (x <= (-6.6d-18)) then
tmp = t_0
else if (x <= 3d+155) then
tmp = (4.0d0 + (x - (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));
double tmp;
if (x <= -6.6e-18) {
tmp = t_0;
} else if (x <= 3e+155) {
tmp = (4.0 + (x - (x * z))) / y;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = math.fabs((x / y)) tmp = 0 if x <= -6.6e-18: tmp = t_0 elif x <= 3e+155: tmp = (4.0 + (x - (x * z))) / y else: tmp = t_0 return tmp
function code(x, y, z) t_0 = abs(Float64(x / y)) tmp = 0.0 if (x <= -6.6e-18) tmp = t_0; elseif (x <= 3e+155) tmp = Float64(Float64(4.0 + Float64(x - Float64(x * z))) / 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 <= -6.6e-18) tmp = t_0; elseif (x <= 3e+155) tmp = (4.0 + (x - (x * z))) / 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, -6.6e-18], t$95$0, If[LessEqual[x, 3e+155], N[(N[(4.0 + N[(x - N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left|\frac{x}{y}\right|\\
\mathbf{if}\;x \leq -6.6 \cdot 10^{-18}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 3 \cdot 10^{+155}:\\
\;\;\;\;\frac{4 + \left(x - x \cdot z\right)}{y}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -6.6000000000000003e-18 or 3.0000000000000001e155 < x Initial program 84.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%
Taylor expanded in x around inf
div-subN/A
associate-/l*N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f6492.5%
Simplified92.5%
Taylor expanded in z around 0
/-lowering-/.f6466.2%
Simplified66.2%
if -6.6000000000000003e-18 < x < 3.0000000000000001e155Initial program 96.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-rr98.2%
fabs-divN/A
clear-numN/A
/-lowering-/.f64N/A
div-fabsN/A
fabs-lowering-fabs.f64N/A
/-lowering-/.f64N/A
associate--l+N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
*-lowering-*.f6498.1%
Applied egg-rr98.1%
clear-numN/A
associate-+r-N/A
div-subN/A
associate-/l*N/A
*-commutativeN/A
associate-/r/N/A
*-lft-identityN/A
inv-powN/A
sqr-powN/A
fabs-sqrN/A
sqr-powN/A
inv-powN/A
clear-numN/A
/-rgt-identityN/A
Applied egg-rr46.6%
(FPCore (x y z)
:precision binary64
(if (<= x -1.9e+110)
(* (/ x y) (- 0.0 z))
(if (<= x 1220.0)
(/ (- 4.0 (* x z)) y)
(if (<= x 1.8e+156) (/ (* x (- 1.0 z)) y) (/ (+ x 4.0) y)))))
double code(double x, double y, double z) {
double tmp;
if (x <= -1.9e+110) {
tmp = (x / y) * (0.0 - z);
} else if (x <= 1220.0) {
tmp = (4.0 - (x * z)) / y;
} else if (x <= 1.8e+156) {
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 <= (-1.9d+110)) then
tmp = (x / y) * (0.0d0 - z)
else if (x <= 1220.0d0) then
tmp = (4.0d0 - (x * z)) / y
else if (x <= 1.8d+156) 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 <= -1.9e+110) {
tmp = (x / y) * (0.0 - z);
} else if (x <= 1220.0) {
tmp = (4.0 - (x * z)) / y;
} else if (x <= 1.8e+156) {
tmp = (x * (1.0 - z)) / y;
} else {
tmp = (x + 4.0) / y;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -1.9e+110: tmp = (x / y) * (0.0 - z) elif x <= 1220.0: tmp = (4.0 - (x * z)) / y elif x <= 1.8e+156: tmp = (x * (1.0 - z)) / y else: tmp = (x + 4.0) / y return tmp
function code(x, y, z) tmp = 0.0 if (x <= -1.9e+110) tmp = Float64(Float64(x / y) * Float64(0.0 - z)); elseif (x <= 1220.0) tmp = Float64(Float64(4.0 - Float64(x * z)) / y); elseif (x <= 1.8e+156) tmp = Float64(Float64(x * 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 <= -1.9e+110) tmp = (x / y) * (0.0 - z); elseif (x <= 1220.0) tmp = (4.0 - (x * z)) / y; elseif (x <= 1.8e+156) tmp = (x * (1.0 - z)) / y; else tmp = (x + 4.0) / y; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -1.9e+110], N[(N[(x / y), $MachinePrecision] * N[(0.0 - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1220.0], N[(N[(4.0 - N[(x * z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[x, 1.8e+156], N[(N[(x * N[(1.0 - z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], N[(N[(x + 4.0), $MachinePrecision] / y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.9 \cdot 10^{+110}:\\
\;\;\;\;\frac{x}{y} \cdot \left(0 - z\right)\\
\mathbf{elif}\;x \leq 1220:\\
\;\;\;\;\frac{4 - x \cdot z}{y}\\
\mathbf{elif}\;x \leq 1.8 \cdot 10^{+156}:\\
\;\;\;\;\frac{x \cdot \left(1 - z\right)}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + 4}{y}\\
\end{array}
\end{array}
if x < -1.89999999999999994e110Initial program 77.4%
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-rr93.9%
fabs-divN/A
clear-numN/A
/-lowering-/.f64N/A
div-fabsN/A
fabs-lowering-fabs.f64N/A
/-lowering-/.f64N/A
associate--l+N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
*-lowering-*.f6493.8%
Applied egg-rr93.8%
clear-numN/A
associate-+r-N/A
div-subN/A
associate-/l*N/A
*-commutativeN/A
associate-/r/N/A
*-lft-identityN/A
inv-powN/A
sqr-powN/A
fabs-sqrN/A
sqr-powN/A
inv-powN/A
clear-numN/A
/-rgt-identityN/A
Applied egg-rr42.4%
Taylor expanded in z around inf
mul-1-negN/A
neg-sub0N/A
--lowering--.f64N/A
*-commutativeN/A
associate-*r/N/A
*-lowering-*.f64N/A
/-lowering-/.f6433.2%
Simplified33.2%
if -1.89999999999999994e110 < x < 1220Initial program 96.9%
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.8%
fabs-divN/A
clear-numN/A
/-lowering-/.f64N/A
div-fabsN/A
fabs-lowering-fabs.f64N/A
/-lowering-/.f64N/A
associate--l+N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
*-lowering-*.f6498.7%
Applied egg-rr98.7%
clear-numN/A
associate-+r-N/A
div-subN/A
associate-/l*N/A
*-commutativeN/A
associate-/r/N/A
*-lft-identityN/A
inv-powN/A
sqr-powN/A
fabs-sqrN/A
sqr-powN/A
inv-powN/A
clear-numN/A
/-rgt-identityN/A
Applied egg-rr46.2%
Taylor expanded in z around inf
mul-1-negN/A
neg-sub0N/A
--lowering--.f64N/A
*-lowering-*.f6442.6%
Simplified42.6%
if 1220 < x < 1.79999999999999989e156Initial program 96.9%
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-rr91.9%
fabs-divN/A
clear-numN/A
/-lowering-/.f64N/A
div-fabsN/A
fabs-lowering-fabs.f64N/A
/-lowering-/.f64N/A
associate--l+N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
*-lowering-*.f6491.6%
Applied egg-rr91.6%
clear-numN/A
associate-+r-N/A
div-subN/A
associate-/l*N/A
*-commutativeN/A
associate-/r/N/A
*-lft-identityN/A
inv-powN/A
sqr-powN/A
fabs-sqrN/A
sqr-powN/A
inv-powN/A
clear-numN/A
/-rgt-identityN/A
Applied egg-rr40.8%
Taylor expanded in x around inf
/-lowering-/.f64N/A
sub-negN/A
mul-1-negN/A
*-lowering-*.f64N/A
mul-1-negN/A
sub-negN/A
--lowering--.f6440.1%
Simplified40.1%
if 1.79999999999999989e156 < x Initial program 75.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-rr94.0%
fabs-divN/A
clear-numN/A
/-lowering-/.f64N/A
div-fabsN/A
fabs-lowering-fabs.f64N/A
/-lowering-/.f64N/A
associate--l+N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
*-lowering-*.f6493.9%
Applied egg-rr93.9%
clear-numN/A
associate-+r-N/A
div-subN/A
associate-/l*N/A
*-commutativeN/A
associate-/r/N/A
*-lft-identityN/A
inv-powN/A
sqr-powN/A
fabs-sqrN/A
sqr-powN/A
inv-powN/A
clear-numN/A
/-rgt-identityN/A
Applied egg-rr33.7%
Taylor expanded in z around 0
/-lowering-/.f64N/A
+-lowering-+.f6438.4%
Simplified38.4%
Final simplification40.6%
(FPCore (x y z)
:precision binary64
(if (<= x -98000000000000.0)
(* (/ x y) (- 0.0 z))
(if (<= x 2.95e-18)
(/ 4.0 y)
(if (<= x 5.2e+155) (/ (* x (- 1.0 z)) y) (/ (+ x 4.0) y)))))
double code(double x, double y, double z) {
double tmp;
if (x <= -98000000000000.0) {
tmp = (x / y) * (0.0 - z);
} else if (x <= 2.95e-18) {
tmp = 4.0 / y;
} else if (x <= 5.2e+155) {
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 <= (-98000000000000.0d0)) then
tmp = (x / y) * (0.0d0 - z)
else if (x <= 2.95d-18) then
tmp = 4.0d0 / y
else if (x <= 5.2d+155) 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 <= -98000000000000.0) {
tmp = (x / y) * (0.0 - z);
} else if (x <= 2.95e-18) {
tmp = 4.0 / y;
} else if (x <= 5.2e+155) {
tmp = (x * (1.0 - z)) / y;
} else {
tmp = (x + 4.0) / y;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -98000000000000.0: tmp = (x / y) * (0.0 - z) elif x <= 2.95e-18: tmp = 4.0 / y elif x <= 5.2e+155: tmp = (x * (1.0 - z)) / y else: tmp = (x + 4.0) / y return tmp
function code(x, y, z) tmp = 0.0 if (x <= -98000000000000.0) tmp = Float64(Float64(x / y) * Float64(0.0 - z)); elseif (x <= 2.95e-18) tmp = Float64(4.0 / y); elseif (x <= 5.2e+155) tmp = Float64(Float64(x * 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 <= -98000000000000.0) tmp = (x / y) * (0.0 - z); elseif (x <= 2.95e-18) tmp = 4.0 / y; elseif (x <= 5.2e+155) tmp = (x * (1.0 - z)) / y; else tmp = (x + 4.0) / y; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -98000000000000.0], N[(N[(x / y), $MachinePrecision] * N[(0.0 - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.95e-18], N[(4.0 / y), $MachinePrecision], If[LessEqual[x, 5.2e+155], N[(N[(x * N[(1.0 - z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], N[(N[(x + 4.0), $MachinePrecision] / y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -98000000000000:\\
\;\;\;\;\frac{x}{y} \cdot \left(0 - z\right)\\
\mathbf{elif}\;x \leq 2.95 \cdot 10^{-18}:\\
\;\;\;\;\frac{4}{y}\\
\mathbf{elif}\;x \leq 5.2 \cdot 10^{+155}:\\
\;\;\;\;\frac{x \cdot \left(1 - z\right)}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + 4}{y}\\
\end{array}
\end{array}
if x < -9.8e13Initial program 87.0%
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-rr93.0%
fabs-divN/A
clear-numN/A
/-lowering-/.f64N/A
div-fabsN/A
fabs-lowering-fabs.f64N/A
/-lowering-/.f64N/A
associate--l+N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
*-lowering-*.f6492.8%
Applied egg-rr92.8%
clear-numN/A
associate-+r-N/A
div-subN/A
associate-/l*N/A
*-commutativeN/A
associate-/r/N/A
*-lft-identityN/A
inv-powN/A
sqr-powN/A
fabs-sqrN/A
sqr-powN/A
inv-powN/A
clear-numN/A
/-rgt-identityN/A
Applied egg-rr35.9%
Taylor expanded in z around inf
mul-1-negN/A
neg-sub0N/A
--lowering--.f64N/A
*-commutativeN/A
associate-*r/N/A
*-lowering-*.f64N/A
/-lowering-/.f6427.2%
Simplified27.2%
if -9.8e13 < x < 2.9500000000000001e-18Initial program 96.2%
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-rr100.0%
fabs-divN/A
clear-numN/A
/-lowering-/.f64N/A
div-fabsN/A
fabs-lowering-fabs.f64N/A
/-lowering-/.f64N/A
associate--l+N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
*-lowering-*.f6499.9%
Applied egg-rr99.9%
clear-numN/A
associate-+r-N/A
div-subN/A
associate-/l*N/A
*-commutativeN/A
associate-/r/N/A
*-lft-identityN/A
inv-powN/A
sqr-powN/A
fabs-sqrN/A
sqr-powN/A
inv-powN/A
clear-numN/A
/-rgt-identityN/A
Applied egg-rr51.1%
Taylor expanded in x around 0
/-lowering-/.f6436.7%
Simplified36.7%
if 2.9500000000000001e-18 < x < 5.2000000000000004e155Initial program 97.5%
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-rr93.4%
fabs-divN/A
clear-numN/A
/-lowering-/.f64N/A
div-fabsN/A
fabs-lowering-fabs.f64N/A
/-lowering-/.f64N/A
associate--l+N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
*-lowering-*.f6493.1%
Applied egg-rr93.1%
clear-numN/A
associate-+r-N/A
div-subN/A
associate-/l*N/A
*-commutativeN/A
associate-/r/N/A
*-lft-identityN/A
inv-powN/A
sqr-powN/A
fabs-sqrN/A
sqr-powN/A
inv-powN/A
clear-numN/A
/-rgt-identityN/A
Applied egg-rr38.0%
Taylor expanded in x around inf
/-lowering-/.f64N/A
sub-negN/A
mul-1-negN/A
*-lowering-*.f64N/A
mul-1-negN/A
sub-negN/A
--lowering--.f6437.0%
Simplified37.0%
if 5.2000000000000004e155 < x Initial program 75.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-rr94.0%
fabs-divN/A
clear-numN/A
/-lowering-/.f64N/A
div-fabsN/A
fabs-lowering-fabs.f64N/A
/-lowering-/.f64N/A
associate--l+N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
*-lowering-*.f6493.9%
Applied egg-rr93.9%
clear-numN/A
associate-+r-N/A
div-subN/A
associate-/l*N/A
*-commutativeN/A
associate-/r/N/A
*-lft-identityN/A
inv-powN/A
sqr-powN/A
fabs-sqrN/A
sqr-powN/A
inv-powN/A
clear-numN/A
/-rgt-identityN/A
Applied egg-rr33.7%
Taylor expanded in z around 0
/-lowering-/.f64N/A
+-lowering-+.f6438.4%
Simplified38.4%
Final simplification35.0%
(FPCore (x y z) :precision binary64 (if (<= x -920.0) (* (/ x y) (- 0.0 z)) (if (<= x 1.2e+157) (/ (+ 4.0 (- x (* x z))) y) (/ (+ x 4.0) y))))
double code(double x, double y, double z) {
double tmp;
if (x <= -920.0) {
tmp = (x / y) * (0.0 - z);
} else if (x <= 1.2e+157) {
tmp = (4.0 + (x - (x * 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 <= (-920.0d0)) then
tmp = (x / y) * (0.0d0 - z)
else if (x <= 1.2d+157) then
tmp = (4.0d0 + (x - (x * 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 <= -920.0) {
tmp = (x / y) * (0.0 - z);
} else if (x <= 1.2e+157) {
tmp = (4.0 + (x - (x * z))) / y;
} else {
tmp = (x + 4.0) / y;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -920.0: tmp = (x / y) * (0.0 - z) elif x <= 1.2e+157: tmp = (4.0 + (x - (x * z))) / y else: tmp = (x + 4.0) / y return tmp
function code(x, y, z) tmp = 0.0 if (x <= -920.0) tmp = Float64(Float64(x / y) * Float64(0.0 - z)); elseif (x <= 1.2e+157) tmp = Float64(Float64(4.0 + Float64(x - Float64(x * 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 <= -920.0) tmp = (x / y) * (0.0 - z); elseif (x <= 1.2e+157) tmp = (4.0 + (x - (x * z))) / y; else tmp = (x + 4.0) / y; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -920.0], N[(N[(x / y), $MachinePrecision] * N[(0.0 - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.2e+157], N[(N[(4.0 + N[(x - N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], N[(N[(x + 4.0), $MachinePrecision] / y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -920:\\
\;\;\;\;\frac{x}{y} \cdot \left(0 - z\right)\\
\mathbf{elif}\;x \leq 1.2 \cdot 10^{+157}:\\
\;\;\;\;\frac{4 + \left(x - x \cdot z\right)}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + 4}{y}\\
\end{array}
\end{array}
if x < -920Initial program 88.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-rr93.7%
fabs-divN/A
clear-numN/A
/-lowering-/.f64N/A
div-fabsN/A
fabs-lowering-fabs.f64N/A
/-lowering-/.f64N/A
associate--l+N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
*-lowering-*.f6493.4%
Applied egg-rr93.4%
clear-numN/A
associate-+r-N/A
div-subN/A
associate-/l*N/A
*-commutativeN/A
associate-/r/N/A
*-lft-identityN/A
inv-powN/A
sqr-powN/A
fabs-sqrN/A
sqr-powN/A
inv-powN/A
clear-numN/A
/-rgt-identityN/A
Applied egg-rr39.1%
Taylor expanded in z around inf
mul-1-negN/A
neg-sub0N/A
--lowering--.f64N/A
*-commutativeN/A
associate-*r/N/A
*-lowering-*.f64N/A
/-lowering-/.f6426.6%
Simplified26.6%
if -920 < x < 1.2e157Initial program 96.4%
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.2%
fabs-divN/A
clear-numN/A
/-lowering-/.f64N/A
div-fabsN/A
fabs-lowering-fabs.f64N/A
/-lowering-/.f64N/A
associate--l+N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
*-lowering-*.f6498.1%
Applied egg-rr98.1%
clear-numN/A
associate-+r-N/A
div-subN/A
associate-/l*N/A
*-commutativeN/A
associate-/r/N/A
*-lft-identityN/A
inv-powN/A
sqr-powN/A
fabs-sqrN/A
sqr-powN/A
inv-powN/A
clear-numN/A
/-rgt-identityN/A
Applied egg-rr47.0%
if 1.2e157 < x Initial program 75.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-rr94.0%
fabs-divN/A
clear-numN/A
/-lowering-/.f64N/A
div-fabsN/A
fabs-lowering-fabs.f64N/A
/-lowering-/.f64N/A
associate--l+N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
*-lowering-*.f6493.9%
Applied egg-rr93.9%
clear-numN/A
associate-+r-N/A
div-subN/A
associate-/l*N/A
*-commutativeN/A
associate-/r/N/A
*-lft-identityN/A
inv-powN/A
sqr-powN/A
fabs-sqrN/A
sqr-powN/A
inv-powN/A
clear-numN/A
/-rgt-identityN/A
Applied egg-rr33.7%
Taylor expanded in z around 0
/-lowering-/.f64N/A
+-lowering-+.f6438.4%
Simplified38.4%
Final simplification41.1%
(FPCore (x y z) :precision binary64 (if (<= x -4.0) (* (/ x y) (- 0.0 z)) (/ (+ x 4.0) y)))
double code(double x, double y, double z) {
double tmp;
if (x <= -4.0) {
tmp = (x / y) * (0.0 - z);
} 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 = (x / y) * (0.0d0 - z)
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 = (x / y) * (0.0 - z);
} else {
tmp = (x + 4.0) / y;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -4.0: tmp = (x / y) * (0.0 - z) else: tmp = (x + 4.0) / y return tmp
function code(x, y, z) tmp = 0.0 if (x <= -4.0) tmp = Float64(Float64(x / y) * Float64(0.0 - z)); 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 = (x / y) * (0.0 - z); else tmp = (x + 4.0) / y; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -4.0], N[(N[(x / y), $MachinePrecision] * N[(0.0 - z), $MachinePrecision]), $MachinePrecision], N[(N[(x + 4.0), $MachinePrecision] / y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4:\\
\;\;\;\;\frac{x}{y} \cdot \left(0 - z\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x + 4}{y}\\
\end{array}
\end{array}
if x < -4Initial program 88.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-rr93.7%
fabs-divN/A
clear-numN/A
/-lowering-/.f64N/A
div-fabsN/A
fabs-lowering-fabs.f64N/A
/-lowering-/.f64N/A
associate--l+N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
*-lowering-*.f6493.4%
Applied egg-rr93.4%
clear-numN/A
associate-+r-N/A
div-subN/A
associate-/l*N/A
*-commutativeN/A
associate-/r/N/A
*-lft-identityN/A
inv-powN/A
sqr-powN/A
fabs-sqrN/A
sqr-powN/A
inv-powN/A
clear-numN/A
/-rgt-identityN/A
Applied egg-rr39.1%
Taylor expanded in z around inf
mul-1-negN/A
neg-sub0N/A
--lowering--.f64N/A
*-commutativeN/A
associate-*r/N/A
*-lowering-*.f64N/A
/-lowering-/.f6426.6%
Simplified26.6%
if -4 < x Initial program 92.9%
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-rr97.5%
fabs-divN/A
clear-numN/A
/-lowering-/.f64N/A
div-fabsN/A
fabs-lowering-fabs.f64N/A
/-lowering-/.f64N/A
associate--l+N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
*-lowering-*.f6497.4%
Applied egg-rr97.4%
clear-numN/A
associate-+r-N/A
div-subN/A
associate-/l*N/A
*-commutativeN/A
associate-/r/N/A
*-lft-identityN/A
inv-powN/A
sqr-powN/A
fabs-sqrN/A
sqr-powN/A
inv-powN/A
clear-numN/A
/-rgt-identityN/A
Applied egg-rr44.7%
Taylor expanded in z around 0
/-lowering-/.f64N/A
+-lowering-+.f6435.0%
Simplified35.0%
Final simplification33.0%
(FPCore (x y z) :precision binary64 (/ (+ x 4.0) y))
double code(double x, double y, double z) {
return (x + 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 = (x + 4.0d0) / y
end function
public static double code(double x, double y, double z) {
return (x + 4.0) / y;
}
def code(x, y, z): return (x + 4.0) / y
function code(x, y, z) return Float64(Float64(x + 4.0) / y) end
function tmp = code(x, y, z) tmp = (x + 4.0) / y; end
code[x_, y_, z_] := N[(N[(x + 4.0), $MachinePrecision] / y), $MachinePrecision]
\begin{array}{l}
\\
\frac{x + 4}{y}
\end{array}
Initial program 91.8%
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-rr96.6%
fabs-divN/A
clear-numN/A
/-lowering-/.f64N/A
div-fabsN/A
fabs-lowering-fabs.f64N/A
/-lowering-/.f64N/A
associate--l+N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
*-lowering-*.f6496.5%
Applied egg-rr96.5%
clear-numN/A
associate-+r-N/A
div-subN/A
associate-/l*N/A
*-commutativeN/A
associate-/r/N/A
*-lft-identityN/A
inv-powN/A
sqr-powN/A
fabs-sqrN/A
sqr-powN/A
inv-powN/A
clear-numN/A
/-rgt-identityN/A
Applied egg-rr43.4%
Taylor expanded in z around 0
/-lowering-/.f64N/A
+-lowering-+.f6433.8%
Simplified33.8%
Final simplification33.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.8%
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-rr96.6%
fabs-divN/A
clear-numN/A
/-lowering-/.f64N/A
div-fabsN/A
fabs-lowering-fabs.f64N/A
/-lowering-/.f64N/A
associate--l+N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
*-lowering-*.f6496.5%
Applied egg-rr96.5%
clear-numN/A
associate-+r-N/A
div-subN/A
associate-/l*N/A
*-commutativeN/A
associate-/r/N/A
*-lft-identityN/A
inv-powN/A
sqr-powN/A
fabs-sqrN/A
sqr-powN/A
inv-powN/A
clear-numN/A
/-rgt-identityN/A
Applied egg-rr43.4%
Taylor expanded in x around 0
/-lowering-/.f6419.8%
Simplified19.8%
herbie shell --seed 2024139
(FPCore (x y z)
:name "fabs fraction 1"
:precision binary64
(fabs (- (/ (+ x 4.0) y) (* (/ x y) z))))