
(FPCore (x y z) :precision binary64 (fabs (- (/ (+ x 4.0) y) (* (/ x y) z))))
double code(double x, double y, double z) {
return fabs((((x + 4.0) / y) - ((x / y) * z)));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = abs((((x + 4.0d0) / y) - ((x / y) * z)))
end function
public static double code(double x, double y, double z) {
return Math.abs((((x + 4.0) / y) - ((x / y) * z)));
}
def code(x, y, z): return math.fabs((((x + 4.0) / y) - ((x / y) * z)))
function code(x, y, z) return abs(Float64(Float64(Float64(x + 4.0) / y) - Float64(Float64(x / y) * z))) end
function tmp = code(x, y, z) tmp = abs((((x + 4.0) / y) - ((x / y) * z))); end
code[x_, y_, z_] := N[Abs[N[(N[(N[(x + 4.0), $MachinePrecision] / y), $MachinePrecision] - N[(N[(x / y), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|\frac{x + 4}{y} - \frac{x}{y} \cdot z\right|
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z) :precision binary64 (fabs (- (/ (+ x 4.0) y) (* (/ x y) z))))
double code(double x, double y, double z) {
return fabs((((x + 4.0) / y) - ((x / y) * z)));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = abs((((x + 4.0d0) / y) - ((x / y) * z)))
end function
public static double code(double x, double y, double z) {
return Math.abs((((x + 4.0) / y) - ((x / y) * z)));
}
def code(x, y, z): return math.fabs((((x + 4.0) / y) - ((x / y) * z)))
function code(x, y, z) return abs(Float64(Float64(Float64(x + 4.0) / y) - Float64(Float64(x / y) * z))) end
function tmp = code(x, y, z) tmp = abs((((x + 4.0) / y) - ((x / y) * z))); end
code[x_, y_, z_] := N[Abs[N[(N[(N[(x + 4.0), $MachinePrecision] / y), $MachinePrecision] - N[(N[(x / y), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|\frac{x + 4}{y} - \frac{x}{y} \cdot z\right|
\end{array}
(FPCore (x y z) :precision binary64 (if (or (<= x -650.0) (not (<= x 3.85))) (fabs (* x (/ (- 1.0 z) y))) (fabs (/ (- (* x z) 4.0) y))))
double code(double x, double y, double z) {
double tmp;
if ((x <= -650.0) || !(x <= 3.85)) {
tmp = fabs((x * ((1.0 - z) / y)));
} else {
tmp = fabs((((x * z) - 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 <= (-650.0d0)) .or. (.not. (x <= 3.85d0))) then
tmp = abs((x * ((1.0d0 - z) / y)))
else
tmp = abs((((x * z) - 4.0d0) / y))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((x <= -650.0) || !(x <= 3.85)) {
tmp = Math.abs((x * ((1.0 - z) / y)));
} else {
tmp = Math.abs((((x * z) - 4.0) / y));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -650.0) or not (x <= 3.85): tmp = math.fabs((x * ((1.0 - z) / y))) else: tmp = math.fabs((((x * z) - 4.0) / y)) return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -650.0) || !(x <= 3.85)) tmp = abs(Float64(x * Float64(Float64(1.0 - z) / y))); else tmp = abs(Float64(Float64(Float64(x * z) - 4.0) / y)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((x <= -650.0) || ~((x <= 3.85))) tmp = abs((x * ((1.0 - z) / y))); else tmp = abs((((x * z) - 4.0) / y)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -650.0], N[Not[LessEqual[x, 3.85]], $MachinePrecision]], N[Abs[N[(x * N[(N[(1.0 - z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[(N[(x * z), $MachinePrecision] - 4.0), $MachinePrecision] / y), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -650 \lor \neg \left(x \leq 3.85\right):\\
\;\;\;\;\left|x \cdot \frac{1 - z}{y}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{x \cdot z - 4}{y}\right|\\
\end{array}
\end{array}
if x < -650 or 3.85000000000000009 < x Initial program 84.9%
Simplified96.6%
Taylor expanded in x around inf 95.9%
*-commutative95.9%
associate-/l*98.9%
associate-*r*98.9%
*-commutative98.9%
associate-*r/98.9%
sub-neg98.9%
metadata-eval98.9%
distribute-lft-in98.9%
neg-mul-198.9%
metadata-eval98.9%
+-commutative98.9%
unsub-neg98.9%
Simplified98.9%
if -650 < x < 3.85000000000000009Initial program 94.9%
associate-*l/99.9%
sub-div99.9%
Applied egg-rr99.9%
Taylor expanded in x around 0 99.6%
Final simplification99.2%
(FPCore (x y z)
:precision binary64
(if (<= z -1.4e+94)
(fabs (/ (* x z) y))
(if (<= z -400000.0)
(/ (- x (- (* x z) 4.0)) y)
(if (<= z 1.75e+26) (fabs (/ (+ x 4.0) y)) (fabs (* x (/ z y)))))))
double code(double x, double y, double z) {
double tmp;
if (z <= -1.4e+94) {
tmp = fabs(((x * z) / y));
} else if (z <= -400000.0) {
tmp = (x - ((x * z) - 4.0)) / y;
} else if (z <= 1.75e+26) {
tmp = fabs(((x + 4.0) / y));
} else {
tmp = fabs((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 (z <= (-1.4d+94)) then
tmp = abs(((x * z) / y))
else if (z <= (-400000.0d0)) then
tmp = (x - ((x * z) - 4.0d0)) / y
else if (z <= 1.75d+26) then
tmp = abs(((x + 4.0d0) / y))
else
tmp = abs((x * (z / y)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -1.4e+94) {
tmp = Math.abs(((x * z) / y));
} else if (z <= -400000.0) {
tmp = (x - ((x * z) - 4.0)) / y;
} else if (z <= 1.75e+26) {
tmp = Math.abs(((x + 4.0) / y));
} else {
tmp = Math.abs((x * (z / y)));
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -1.4e+94: tmp = math.fabs(((x * z) / y)) elif z <= -400000.0: tmp = (x - ((x * z) - 4.0)) / y elif z <= 1.75e+26: tmp = math.fabs(((x + 4.0) / y)) else: tmp = math.fabs((x * (z / y))) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -1.4e+94) tmp = abs(Float64(Float64(x * z) / y)); elseif (z <= -400000.0) tmp = Float64(Float64(x - Float64(Float64(x * z) - 4.0)) / y); elseif (z <= 1.75e+26) tmp = abs(Float64(Float64(x + 4.0) / y)); else tmp = abs(Float64(x * Float64(z / y))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -1.4e+94) tmp = abs(((x * z) / y)); elseif (z <= -400000.0) tmp = (x - ((x * z) - 4.0)) / y; elseif (z <= 1.75e+26) tmp = abs(((x + 4.0) / y)); else tmp = abs((x * (z / y))); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -1.4e+94], N[Abs[N[(N[(x * z), $MachinePrecision] / y), $MachinePrecision]], $MachinePrecision], If[LessEqual[z, -400000.0], N[(N[(x - N[(N[(x * z), $MachinePrecision] - 4.0), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[z, 1.75e+26], N[Abs[N[(N[(x + 4.0), $MachinePrecision] / y), $MachinePrecision]], $MachinePrecision], N[Abs[N[(x * N[(z / y), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.4 \cdot 10^{+94}:\\
\;\;\;\;\left|\frac{x \cdot z}{y}\right|\\
\mathbf{elif}\;z \leq -400000:\\
\;\;\;\;\frac{x - \left(x \cdot z - 4\right)}{y}\\
\mathbf{elif}\;z \leq 1.75 \cdot 10^{+26}:\\
\;\;\;\;\left|\frac{x + 4}{y}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|x \cdot \frac{z}{y}\right|\\
\end{array}
\end{array}
if z < -1.39999999999999999e94Initial program 90.5%
Simplified97.7%
Taylor expanded in z around inf 84.4%
mul-1-neg84.4%
distribute-frac-neg84.4%
distribute-lft-neg-in84.4%
*-commutative84.4%
Simplified84.4%
if -1.39999999999999999e94 < z < -4e5Initial program 99.6%
Simplified99.5%
Taylor expanded in y around 0 99.8%
mul-1-neg99.8%
+-commutative99.8%
distribute-neg-frac299.8%
fmm-def99.7%
distribute-neg-in99.7%
metadata-eval99.7%
+-commutative99.7%
sub-neg99.7%
rem-square-sqrt53.6%
fabs-sqr53.6%
rem-square-sqrt55.1%
distribute-frac-neg255.1%
distribute-frac-neg55.1%
neg-sub055.1%
Simplified55.1%
Taylor expanded in x around 0 55.1%
if -4e5 < z < 1.75e26Initial program 93.6%
Simplified99.9%
Taylor expanded in z around 0 99.4%
+-commutative99.4%
Simplified99.4%
if 1.75e26 < z Initial program 75.6%
Simplified94.1%
Taylor expanded in z around inf 76.3%
mul-1-neg76.3%
associate-*r/77.9%
*-commutative77.9%
distribute-rgt-neg-in77.9%
Simplified77.9%
Final simplification88.7%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (fabs (* x (/ z y)))))
(if (<= z -1e+94)
t_0
(if (<= z -48000.0)
(/ (+ x (- 4.0 (* x z))) y)
(if (<= z 4e+25) (fabs (/ (+ x 4.0) y)) t_0)))))
double code(double x, double y, double z) {
double t_0 = fabs((x * (z / y)));
double tmp;
if (z <= -1e+94) {
tmp = t_0;
} else if (z <= -48000.0) {
tmp = (x + (4.0 - (x * z))) / y;
} else if (z <= 4e+25) {
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 = abs((x * (z / y)))
if (z <= (-1d+94)) then
tmp = t_0
else if (z <= (-48000.0d0)) then
tmp = (x + (4.0d0 - (x * z))) / y
else if (z <= 4d+25) 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 = Math.abs((x * (z / y)));
double tmp;
if (z <= -1e+94) {
tmp = t_0;
} else if (z <= -48000.0) {
tmp = (x + (4.0 - (x * z))) / y;
} else if (z <= 4e+25) {
tmp = Math.abs(((x + 4.0) / y));
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = math.fabs((x * (z / y))) tmp = 0 if z <= -1e+94: tmp = t_0 elif z <= -48000.0: tmp = (x + (4.0 - (x * z))) / y elif z <= 4e+25: tmp = math.fabs(((x + 4.0) / y)) else: tmp = t_0 return tmp
function code(x, y, z) t_0 = abs(Float64(x * Float64(z / y))) tmp = 0.0 if (z <= -1e+94) tmp = t_0; elseif (z <= -48000.0) tmp = Float64(Float64(x + Float64(4.0 - Float64(x * z))) / y); elseif (z <= 4e+25) 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 = abs((x * (z / y))); tmp = 0.0; if (z <= -1e+94) tmp = t_0; elseif (z <= -48000.0) tmp = (x + (4.0 - (x * z))) / y; elseif (z <= 4e+25) tmp = abs(((x + 4.0) / y)); else tmp = t_0; 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[z, -1e+94], t$95$0, If[LessEqual[z, -48000.0], N[(N[(x + N[(4.0 - N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[z, 4e+25], N[Abs[N[(N[(x + 4.0), $MachinePrecision] / y), $MachinePrecision]], $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left|x \cdot \frac{z}{y}\right|\\
\mathbf{if}\;z \leq -1 \cdot 10^{+94}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -48000:\\
\;\;\;\;\frac{x + \left(4 - x \cdot z\right)}{y}\\
\mathbf{elif}\;z \leq 4 \cdot 10^{+25}:\\
\;\;\;\;\left|\frac{x + 4}{y}\right|\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -1e94 or 4.00000000000000036e25 < z Initial program 82.5%
Simplified95.7%
Taylor expanded in z around inf 80.1%
mul-1-neg80.1%
associate-*r/78.9%
*-commutative78.9%
distribute-rgt-neg-in78.9%
Simplified78.9%
if -1e94 < z < -48000Initial program 99.6%
Simplified99.5%
Taylor expanded in y around 0 99.8%
mul-1-neg99.8%
+-commutative99.8%
distribute-neg-frac299.8%
fmm-def99.7%
distribute-neg-in99.7%
metadata-eval99.7%
+-commutative99.7%
sub-neg99.7%
rem-square-sqrt53.6%
fabs-sqr53.6%
rem-square-sqrt55.1%
distribute-frac-neg255.1%
distribute-frac-neg55.1%
neg-sub055.1%
Simplified55.1%
Taylor expanded in x around 0 55.1%
if -48000 < z < 4.00000000000000036e25Initial program 93.6%
Simplified99.9%
Taylor expanded in z around 0 99.4%
+-commutative99.4%
Simplified99.4%
Final simplification88.0%
(FPCore (x y z) :precision binary64 (if (or (<= x -4.0) (not (<= x 1.45e-34))) (fabs (* x (/ (- 1.0 z) y))) (+ (* (* x z) (/ -1.0 y)) (/ (+ x 4.0) y))))
double code(double x, double y, double z) {
double tmp;
if ((x <= -4.0) || !(x <= 1.45e-34)) {
tmp = fabs((x * ((1.0 - z) / y)));
} else {
tmp = ((x * z) * (-1.0 / y)) + ((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)) .or. (.not. (x <= 1.45d-34))) then
tmp = abs((x * ((1.0d0 - z) / y)))
else
tmp = ((x * z) * ((-1.0d0) / y)) + ((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) || !(x <= 1.45e-34)) {
tmp = Math.abs((x * ((1.0 - z) / y)));
} else {
tmp = ((x * z) * (-1.0 / y)) + ((x + 4.0) / y);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -4.0) or not (x <= 1.45e-34): tmp = math.fabs((x * ((1.0 - z) / y))) else: tmp = ((x * z) * (-1.0 / y)) + ((x + 4.0) / y) return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -4.0) || !(x <= 1.45e-34)) tmp = abs(Float64(x * Float64(Float64(1.0 - z) / y))); else tmp = Float64(Float64(Float64(x * z) * Float64(-1.0 / y)) + Float64(Float64(x + 4.0) / y)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((x <= -4.0) || ~((x <= 1.45e-34))) tmp = abs((x * ((1.0 - z) / y))); else tmp = ((x * z) * (-1.0 / y)) + ((x + 4.0) / y); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -4.0], N[Not[LessEqual[x, 1.45e-34]], $MachinePrecision]], N[Abs[N[(x * N[(N[(1.0 - z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[(N[(x * z), $MachinePrecision] * N[(-1.0 / y), $MachinePrecision]), $MachinePrecision] + N[(N[(x + 4.0), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4 \lor \neg \left(x \leq 1.45 \cdot 10^{-34}\right):\\
\;\;\;\;\left|x \cdot \frac{1 - z}{y}\right|\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot z\right) \cdot \frac{-1}{y} + \frac{x + 4}{y}\\
\end{array}
\end{array}
if x < -4 or 1.4500000000000001e-34 < x Initial program 85.8%
Simplified96.8%
Taylor expanded in x around inf 96.1%
*-commutative96.1%
associate-/l*98.9%
associate-*r*98.9%
*-commutative98.9%
associate-*r/98.9%
sub-neg98.9%
metadata-eval98.9%
distribute-lft-in98.9%
neg-mul-198.9%
metadata-eval98.9%
+-commutative98.9%
unsub-neg98.9%
Simplified98.9%
if -4 < x < 1.4500000000000001e-34Initial program 94.6%
Simplified99.9%
add-sqr-sqrt50.4%
fabs-sqr50.4%
add-sqr-sqrt51.8%
fma-undefine51.8%
distribute-rgt-in51.8%
sub-neg51.8%
metadata-eval51.8%
distribute-neg-in51.8%
+-commutative51.8%
frac-2neg51.8%
metadata-eval51.8%
div-inv51.8%
frac-2neg51.8%
Applied egg-rr51.8%
Final simplification75.4%
(FPCore (x y z) :precision binary64 (fabs (/ (- (* x z) (+ x 4.0)) y)))
double code(double x, double y, double z) {
return fabs((((x * z) - (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 = abs((((x * z) - (x + 4.0d0)) / y))
end function
public static double code(double x, double y, double z) {
return Math.abs((((x * z) - (x + 4.0)) / y));
}
def code(x, y, z): return math.fabs((((x * z) - (x + 4.0)) / y))
function code(x, y, z) return abs(Float64(Float64(Float64(x * z) - Float64(x + 4.0)) / y)) end
function tmp = code(x, y, z) tmp = abs((((x * z) - (x + 4.0)) / y)); end
code[x_, y_, z_] := N[Abs[N[(N[(N[(x * z), $MachinePrecision] - N[(x + 4.0), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|\frac{x \cdot z - \left(x + 4\right)}{y}\right|
\end{array}
Initial program 90.2%
associate-*l/93.4%
sub-div98.4%
Applied egg-rr98.4%
Final simplification98.4%
(FPCore (x y z) :precision binary64 (if (<= x -0.088) (/ (- (* x z) x) y) (if (<= x 4.0) (/ (- 4.0 (* x z)) y) (/ (- x (* x z)) y))))
double code(double x, double y, double z) {
double tmp;
if (x <= -0.088) {
tmp = ((x * z) - x) / y;
} else if (x <= 4.0) {
tmp = (4.0 - (x * z)) / y;
} else {
tmp = (x - (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 <= (-0.088d0)) then
tmp = ((x * z) - x) / y
else if (x <= 4.0d0) then
tmp = (4.0d0 - (x * z)) / y
else
tmp = (x - (x * z)) / y
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -0.088) {
tmp = ((x * z) - x) / y;
} else if (x <= 4.0) {
tmp = (4.0 - (x * z)) / y;
} else {
tmp = (x - (x * z)) / y;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -0.088: tmp = ((x * z) - x) / y elif x <= 4.0: tmp = (4.0 - (x * z)) / y else: tmp = (x - (x * z)) / y return tmp
function code(x, y, z) tmp = 0.0 if (x <= -0.088) tmp = Float64(Float64(Float64(x * z) - x) / y); elseif (x <= 4.0) tmp = Float64(Float64(4.0 - Float64(x * z)) / y); else tmp = Float64(Float64(x - Float64(x * z)) / y); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -0.088) tmp = ((x * z) - x) / y; elseif (x <= 4.0) tmp = (4.0 - (x * z)) / y; else tmp = (x - (x * z)) / y; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -0.088], N[(N[(N[(x * z), $MachinePrecision] - x), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[x, 4.0], N[(N[(4.0 - N[(x * z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], N[(N[(x - N[(x * z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -0.088:\\
\;\;\;\;\frac{x \cdot z - x}{y}\\
\mathbf{elif}\;x \leq 4:\\
\;\;\;\;\frac{4 - x \cdot z}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x - x \cdot z}{y}\\
\end{array}
\end{array}
if x < -0.087999999999999995Initial program 85.6%
associate-*l/87.6%
sub-div95.5%
Applied egg-rr95.5%
add-sqr-sqrt44.6%
fabs-sqr44.6%
add-sqr-sqrt45.1%
frac-2neg45.1%
cancel-sign-sub-inv45.1%
*-commutative45.1%
distribute-neg-in45.1%
distribute-neg-in45.1%
add-sqr-sqrt45.0%
sqrt-unprod35.6%
sqr-neg35.6%
sqrt-unprod0.0%
add-sqr-sqrt56.0%
metadata-eval56.0%
distribute-rgt-neg-out56.0%
*-commutative56.0%
remove-double-neg56.0%
Applied egg-rr56.0%
*-commutative56.0%
add-sqr-sqrt30.4%
sqrt-unprod57.7%
sqr-neg57.7%
sqrt-unprod30.2%
add-sqr-sqrt51.0%
cancel-sign-sub-inv51.0%
Applied egg-rr51.0%
Taylor expanded in x around inf 51.0%
if -0.087999999999999995 < x < 4Initial program 94.9%
add-sqr-sqrt49.4%
fabs-sqr49.4%
add-sqr-sqrt50.8%
associate-*l/52.1%
associate-/l*47.3%
Applied egg-rr47.3%
Taylor expanded in x around 0 46.9%
associate-*r/51.8%
sub-div51.8%
*-commutative51.8%
Applied egg-rr51.8%
if 4 < x Initial program 84.4%
Simplified98.1%
Taylor expanded in y around 0 98.3%
mul-1-neg98.3%
+-commutative98.3%
distribute-neg-frac298.3%
fmm-def98.2%
distribute-neg-in98.2%
metadata-eval98.2%
+-commutative98.2%
sub-neg98.2%
rem-square-sqrt37.7%
fabs-sqr37.7%
rem-square-sqrt38.4%
distribute-frac-neg238.4%
distribute-frac-neg38.4%
neg-sub038.4%
Simplified38.4%
Taylor expanded in x around inf 37.2%
Final simplification48.3%
(FPCore (x y z) :precision binary64 (if (<= x -620.0) (/ (- 4.0 x) y) (if (<= x 4.0) (/ (- 4.0 (* x z)) y) (/ (- x (* x z)) y))))
double code(double x, double y, double z) {
double tmp;
if (x <= -620.0) {
tmp = (4.0 - x) / y;
} else if (x <= 4.0) {
tmp = (4.0 - (x * z)) / y;
} else {
tmp = (x - (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 <= (-620.0d0)) then
tmp = (4.0d0 - x) / y
else if (x <= 4.0d0) then
tmp = (4.0d0 - (x * z)) / y
else
tmp = (x - (x * z)) / y
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -620.0) {
tmp = (4.0 - x) / y;
} else if (x <= 4.0) {
tmp = (4.0 - (x * z)) / y;
} else {
tmp = (x - (x * z)) / y;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -620.0: tmp = (4.0 - x) / y elif x <= 4.0: tmp = (4.0 - (x * z)) / y else: tmp = (x - (x * z)) / y return tmp
function code(x, y, z) tmp = 0.0 if (x <= -620.0) tmp = Float64(Float64(4.0 - x) / y); elseif (x <= 4.0) tmp = Float64(Float64(4.0 - Float64(x * z)) / y); else tmp = Float64(Float64(x - Float64(x * z)) / y); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -620.0) tmp = (4.0 - x) / y; elseif (x <= 4.0) tmp = (4.0 - (x * z)) / y; else tmp = (x - (x * z)) / y; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -620.0], N[(N[(4.0 - x), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[x, 4.0], N[(N[(4.0 - N[(x * z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], N[(N[(x - N[(x * z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -620:\\
\;\;\;\;\frac{4 - x}{y}\\
\mathbf{elif}\;x \leq 4:\\
\;\;\;\;\frac{4 - x \cdot z}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x - x \cdot z}{y}\\
\end{array}
\end{array}
if x < -620Initial program 85.6%
associate-*l/87.6%
sub-div95.5%
Applied egg-rr95.5%
add-sqr-sqrt44.6%
fabs-sqr44.6%
add-sqr-sqrt45.1%
frac-2neg45.1%
cancel-sign-sub-inv45.1%
*-commutative45.1%
distribute-neg-in45.1%
distribute-neg-in45.1%
add-sqr-sqrt45.0%
sqrt-unprod35.6%
sqr-neg35.6%
sqrt-unprod0.0%
add-sqr-sqrt56.0%
metadata-eval56.0%
distribute-rgt-neg-out56.0%
*-commutative56.0%
remove-double-neg56.0%
Applied egg-rr56.0%
*-commutative56.0%
add-sqr-sqrt30.4%
sqrt-unprod57.7%
sqr-neg57.7%
sqrt-unprod30.2%
add-sqr-sqrt51.0%
cancel-sign-sub-inv51.0%
Applied egg-rr51.0%
Taylor expanded in z around 0 42.9%
sub-neg42.9%
metadata-eval42.9%
neg-mul-142.9%
distribute-frac-neg42.9%
neg-sub042.9%
+-commutative42.9%
associate--r+42.9%
metadata-eval42.9%
Simplified42.9%
if -620 < x < 4Initial program 94.9%
add-sqr-sqrt49.4%
fabs-sqr49.4%
add-sqr-sqrt50.8%
associate-*l/52.1%
associate-/l*47.3%
Applied egg-rr47.3%
Taylor expanded in x around 0 46.9%
associate-*r/51.8%
sub-div51.8%
*-commutative51.8%
Applied egg-rr51.8%
if 4 < x Initial program 84.4%
Simplified98.1%
Taylor expanded in y around 0 98.3%
mul-1-neg98.3%
+-commutative98.3%
distribute-neg-frac298.3%
fmm-def98.2%
distribute-neg-in98.2%
metadata-eval98.2%
+-commutative98.2%
sub-neg98.2%
rem-square-sqrt37.7%
fabs-sqr37.7%
rem-square-sqrt38.4%
distribute-frac-neg238.4%
distribute-frac-neg38.4%
neg-sub038.4%
Simplified38.4%
Taylor expanded in x around inf 37.2%
Final simplification46.3%
(FPCore (x y z) :precision binary64 (if (<= x -520.0) (/ (- 4.0 x) y) (if (<= x 88.0) (/ (- 4.0 (* x z)) y) (/ (- x -4.0) y))))
double code(double x, double y, double z) {
double tmp;
if (x <= -520.0) {
tmp = (4.0 - x) / y;
} else if (x <= 88.0) {
tmp = (4.0 - (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 <= (-520.0d0)) then
tmp = (4.0d0 - x) / y
else if (x <= 88.0d0) then
tmp = (4.0d0 - (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 <= -520.0) {
tmp = (4.0 - x) / y;
} else if (x <= 88.0) {
tmp = (4.0 - (x * z)) / y;
} else {
tmp = (x - -4.0) / y;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -520.0: tmp = (4.0 - x) / y elif x <= 88.0: tmp = (4.0 - (x * z)) / y else: tmp = (x - -4.0) / y return tmp
function code(x, y, z) tmp = 0.0 if (x <= -520.0) tmp = Float64(Float64(4.0 - x) / y); elseif (x <= 88.0) tmp = Float64(Float64(4.0 - 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 <= -520.0) tmp = (4.0 - x) / y; elseif (x <= 88.0) tmp = (4.0 - (x * z)) / y; else tmp = (x - -4.0) / y; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -520.0], N[(N[(4.0 - x), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[x, 88.0], N[(N[(4.0 - N[(x * z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], N[(N[(x - -4.0), $MachinePrecision] / y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -520:\\
\;\;\;\;\frac{4 - x}{y}\\
\mathbf{elif}\;x \leq 88:\\
\;\;\;\;\frac{4 - x \cdot z}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x - -4}{y}\\
\end{array}
\end{array}
if x < -520Initial program 85.6%
associate-*l/87.6%
sub-div95.5%
Applied egg-rr95.5%
add-sqr-sqrt44.6%
fabs-sqr44.6%
add-sqr-sqrt45.1%
frac-2neg45.1%
cancel-sign-sub-inv45.1%
*-commutative45.1%
distribute-neg-in45.1%
distribute-neg-in45.1%
add-sqr-sqrt45.0%
sqrt-unprod35.6%
sqr-neg35.6%
sqrt-unprod0.0%
add-sqr-sqrt56.0%
metadata-eval56.0%
distribute-rgt-neg-out56.0%
*-commutative56.0%
remove-double-neg56.0%
Applied egg-rr56.0%
*-commutative56.0%
add-sqr-sqrt30.4%
sqrt-unprod57.7%
sqr-neg57.7%
sqrt-unprod30.2%
add-sqr-sqrt51.0%
cancel-sign-sub-inv51.0%
Applied egg-rr51.0%
Taylor expanded in z around 0 42.9%
sub-neg42.9%
metadata-eval42.9%
neg-mul-142.9%
distribute-frac-neg42.9%
neg-sub042.9%
+-commutative42.9%
associate--r+42.9%
metadata-eval42.9%
Simplified42.9%
if -520 < x < 88Initial program 94.9%
add-sqr-sqrt49.8%
fabs-sqr49.8%
add-sqr-sqrt51.1%
associate-*l/52.5%
associate-/l*47.7%
Applied egg-rr47.7%
Taylor expanded in x around 0 47.3%
associate-*r/52.1%
sub-div52.2%
*-commutative52.2%
Applied egg-rr52.2%
if 88 < x Initial program 84.1%
Simplified98.1%
Taylor expanded in y around 0 98.2%
mul-1-neg98.2%
+-commutative98.2%
distribute-neg-frac298.2%
fmm-def98.2%
distribute-neg-in98.2%
metadata-eval98.2%
+-commutative98.2%
sub-neg98.2%
rem-square-sqrt36.6%
fabs-sqr36.6%
rem-square-sqrt37.3%
distribute-frac-neg237.3%
distribute-frac-neg37.3%
neg-sub037.3%
Simplified37.3%
Taylor expanded in x around 0 33.6%
Final simplification45.7%
(FPCore (x y z) :precision binary64 (if (<= x 6.4e-14) (/ (- 4.0 x) y) (if (<= x 215.0) (* z (/ x (- y))) (/ (- x -4.0) y))))
double code(double x, double y, double z) {
double tmp;
if (x <= 6.4e-14) {
tmp = (4.0 - x) / y;
} else if (x <= 215.0) {
tmp = z * (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 <= 6.4d-14) then
tmp = (4.0d0 - x) / y
else if (x <= 215.0d0) then
tmp = z * (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 <= 6.4e-14) {
tmp = (4.0 - x) / y;
} else if (x <= 215.0) {
tmp = z * (x / -y);
} else {
tmp = (x - -4.0) / y;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= 6.4e-14: tmp = (4.0 - x) / y elif x <= 215.0: tmp = z * (x / -y) else: tmp = (x - -4.0) / y return tmp
function code(x, y, z) tmp = 0.0 if (x <= 6.4e-14) tmp = Float64(Float64(4.0 - x) / y); elseif (x <= 215.0) tmp = Float64(z * Float64(x / Float64(-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 <= 6.4e-14) tmp = (4.0 - x) / y; elseif (x <= 215.0) tmp = z * (x / -y); else tmp = (x - -4.0) / y; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 6.4e-14], N[(N[(4.0 - x), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[x, 215.0], N[(z * N[(x / (-y)), $MachinePrecision]), $MachinePrecision], N[(N[(x - -4.0), $MachinePrecision] / y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 6.4 \cdot 10^{-14}:\\
\;\;\;\;\frac{4 - x}{y}\\
\mathbf{elif}\;x \leq 215:\\
\;\;\;\;z \cdot \frac{x}{-y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x - -4}{y}\\
\end{array}
\end{array}
if x < 6.4000000000000005e-14Initial program 91.7%
associate-*l/95.9%
sub-div98.5%
Applied egg-rr98.5%
add-sqr-sqrt48.7%
fabs-sqr48.7%
add-sqr-sqrt49.9%
frac-2neg49.9%
cancel-sign-sub-inv49.9%
*-commutative49.9%
distribute-neg-in49.9%
distribute-neg-in49.9%
add-sqr-sqrt34.9%
sqrt-unprod46.8%
sqr-neg46.8%
sqrt-unprod14.9%
add-sqr-sqrt53.2%
metadata-eval53.2%
distribute-rgt-neg-out53.2%
*-commutative53.2%
remove-double-neg53.2%
Applied egg-rr53.2%
*-commutative53.2%
add-sqr-sqrt25.4%
sqrt-unprod48.4%
sqr-neg48.4%
sqrt-unprod29.3%
add-sqr-sqrt48.1%
cancel-sign-sub-inv48.1%
Applied egg-rr48.1%
Taylor expanded in z around 0 40.5%
sub-neg40.5%
metadata-eval40.5%
neg-mul-140.5%
distribute-frac-neg40.5%
neg-sub040.5%
+-commutative40.5%
associate--r+40.5%
metadata-eval40.5%
Simplified40.5%
if 6.4000000000000005e-14 < x < 215Initial program 99.8%
Simplified99.8%
Taylor expanded in z around inf 99.3%
mul-1-neg99.3%
distribute-frac-neg99.3%
distribute-lft-neg-in99.3%
*-commutative99.3%
Simplified99.3%
add-sqr-sqrt56.9%
fabs-sqr56.9%
add-sqr-sqrt57.2%
associate-/l*57.2%
distribute-frac-neg57.2%
add-sqr-sqrt56.9%
sqrt-unprod57.2%
sqr-neg57.2%
sqrt-unprod0.0%
add-sqr-sqrt42.5%
distribute-rgt-neg-in42.5%
distribute-lft-neg-in42.5%
add-sqr-sqrt0.0%
sqrt-unprod57.2%
sqr-neg57.2%
sqrt-unprod56.9%
add-sqr-sqrt57.2%
Applied egg-rr57.2%
if 215 < x Initial program 84.1%
Simplified98.1%
Taylor expanded in y around 0 98.2%
mul-1-neg98.2%
+-commutative98.2%
distribute-neg-frac298.2%
fmm-def98.2%
distribute-neg-in98.2%
metadata-eval98.2%
+-commutative98.2%
sub-neg98.2%
rem-square-sqrt36.6%
fabs-sqr36.6%
rem-square-sqrt37.3%
distribute-frac-neg237.3%
distribute-frac-neg37.3%
neg-sub037.3%
Simplified37.3%
Taylor expanded in x around 0 33.6%
Final simplification39.4%
(FPCore (x y z) :precision binary64 (if (<= x -3.1) (/ (- (* x z) x) y) (/ (- x (- (* x z) 4.0)) y)))
double code(double x, double y, double z) {
double tmp;
if (x <= -3.1) {
tmp = ((x * z) - x) / y;
} else {
tmp = (x - ((x * z) - 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.1d0)) then
tmp = ((x * z) - x) / y
else
tmp = (x - ((x * z) - 4.0d0)) / y
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -3.1) {
tmp = ((x * z) - x) / y;
} else {
tmp = (x - ((x * z) - 4.0)) / y;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -3.1: tmp = ((x * z) - x) / y else: tmp = (x - ((x * z) - 4.0)) / y return tmp
function code(x, y, z) tmp = 0.0 if (x <= -3.1) tmp = Float64(Float64(Float64(x * z) - x) / y); else tmp = Float64(Float64(x - Float64(Float64(x * z) - 4.0)) / y); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -3.1) tmp = ((x * z) - x) / y; else tmp = (x - ((x * z) - 4.0)) / y; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -3.1], N[(N[(N[(x * z), $MachinePrecision] - x), $MachinePrecision] / y), $MachinePrecision], N[(N[(x - N[(N[(x * z), $MachinePrecision] - 4.0), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.1:\\
\;\;\;\;\frac{x \cdot z - x}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x - \left(x \cdot z - 4\right)}{y}\\
\end{array}
\end{array}
if x < -3.10000000000000009Initial program 85.6%
associate-*l/87.6%
sub-div95.5%
Applied egg-rr95.5%
add-sqr-sqrt44.6%
fabs-sqr44.6%
add-sqr-sqrt45.1%
frac-2neg45.1%
cancel-sign-sub-inv45.1%
*-commutative45.1%
distribute-neg-in45.1%
distribute-neg-in45.1%
add-sqr-sqrt45.0%
sqrt-unprod35.6%
sqr-neg35.6%
sqrt-unprod0.0%
add-sqr-sqrt56.0%
metadata-eval56.0%
distribute-rgt-neg-out56.0%
*-commutative56.0%
remove-double-neg56.0%
Applied egg-rr56.0%
*-commutative56.0%
add-sqr-sqrt30.4%
sqrt-unprod57.7%
sqr-neg57.7%
sqrt-unprod30.2%
add-sqr-sqrt51.0%
cancel-sign-sub-inv51.0%
Applied egg-rr51.0%
Taylor expanded in x around inf 51.0%
if -3.10000000000000009 < x Initial program 91.7%
Simplified99.4%
Taylor expanded in y around 0 99.4%
mul-1-neg99.4%
+-commutative99.4%
distribute-neg-frac299.4%
fmm-def99.4%
distribute-neg-in99.4%
metadata-eval99.4%
+-commutative99.4%
sub-neg99.4%
rem-square-sqrt46.8%
fabs-sqr46.8%
rem-square-sqrt48.0%
distribute-frac-neg248.0%
distribute-frac-neg48.0%
neg-sub048.0%
Simplified48.0%
Taylor expanded in x around 0 48.0%
Final simplification48.7%
(FPCore (x y z) :precision binary64 (if (<= x -8.5e-5) (* z (/ x y)) (if (<= x 4.0) (/ 4.0 y) (/ x y))))
double code(double x, double y, double z) {
double tmp;
if (x <= -8.5e-5) {
tmp = z * (x / y);
} 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 <= (-8.5d-5)) then
tmp = z * (x / y)
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 <= -8.5e-5) {
tmp = z * (x / y);
} else if (x <= 4.0) {
tmp = 4.0 / y;
} else {
tmp = x / y;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -8.5e-5: tmp = z * (x / y) elif x <= 4.0: tmp = 4.0 / y else: tmp = x / y return tmp
function code(x, y, z) tmp = 0.0 if (x <= -8.5e-5) tmp = Float64(z * Float64(x / y)); 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 <= -8.5e-5) tmp = z * (x / y); elseif (x <= 4.0) tmp = 4.0 / y; else tmp = x / y; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -8.5e-5], N[(z * N[(x / y), $MachinePrecision]), $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 -8.5 \cdot 10^{-5}:\\
\;\;\;\;z \cdot \frac{x}{y}\\
\mathbf{elif}\;x \leq 4:\\
\;\;\;\;\frac{4}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\
\end{array}
\end{array}
if x < -8.500000000000001e-5Initial program 85.6%
Simplified95.3%
Taylor expanded in z around inf 54.9%
mul-1-neg54.9%
distribute-frac-neg54.9%
distribute-lft-neg-in54.9%
*-commutative54.9%
Simplified54.9%
add-sqr-sqrt30.2%
fabs-sqr30.2%
add-sqr-sqrt30.6%
associate-/l*39.3%
*-commutative39.3%
add-sqr-sqrt39.3%
sqrt-unprod33.4%
sqr-neg33.4%
sqrt-unprod0.0%
add-sqr-sqrt32.7%
Applied egg-rr32.7%
if -8.500000000000001e-5 < x < 4Initial program 94.9%
Simplified99.9%
Taylor expanded in y around 0 99.9%
mul-1-neg99.9%
+-commutative99.9%
distribute-neg-frac299.9%
fmm-def99.9%
distribute-neg-in99.9%
metadata-eval99.9%
+-commutative99.9%
sub-neg99.9%
rem-square-sqrt50.7%
fabs-sqr50.7%
rem-square-sqrt52.1%
distribute-frac-neg252.1%
distribute-frac-neg52.1%
neg-sub052.1%
Simplified52.1%
Taylor expanded in x around 0 37.8%
if 4 < x Initial program 84.4%
Simplified98.1%
Taylor expanded in y around 0 98.3%
mul-1-neg98.3%
+-commutative98.3%
distribute-neg-frac298.3%
fmm-def98.2%
distribute-neg-in98.2%
metadata-eval98.2%
+-commutative98.2%
sub-neg98.2%
rem-square-sqrt37.7%
fabs-sqr37.7%
rem-square-sqrt38.4%
distribute-frac-neg238.4%
distribute-frac-neg38.4%
neg-sub038.4%
Simplified38.4%
Taylor expanded in x around 0 33.1%
Taylor expanded in x around inf 31.9%
Final simplification35.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 85.6%
associate-*l/87.6%
sub-div95.5%
Applied egg-rr95.5%
add-sqr-sqrt44.6%
fabs-sqr44.6%
add-sqr-sqrt45.1%
frac-2neg45.1%
cancel-sign-sub-inv45.1%
*-commutative45.1%
distribute-neg-in45.1%
distribute-neg-in45.1%
add-sqr-sqrt45.0%
sqrt-unprod35.6%
sqr-neg35.6%
sqrt-unprod0.0%
add-sqr-sqrt56.0%
metadata-eval56.0%
distribute-rgt-neg-out56.0%
*-commutative56.0%
remove-double-neg56.0%
Applied egg-rr56.0%
*-commutative56.0%
add-sqr-sqrt30.4%
sqrt-unprod57.7%
sqr-neg57.7%
sqrt-unprod30.2%
add-sqr-sqrt51.0%
cancel-sign-sub-inv51.0%
Applied egg-rr51.0%
Taylor expanded in z around 0 42.9%
sub-neg42.9%
metadata-eval42.9%
neg-mul-142.9%
distribute-frac-neg42.9%
neg-sub042.9%
+-commutative42.9%
associate--r+42.9%
metadata-eval42.9%
Simplified42.9%
if -4 < x Initial program 91.7%
Simplified99.4%
Taylor expanded in y around 0 99.4%
mul-1-neg99.4%
+-commutative99.4%
distribute-neg-frac299.4%
fmm-def99.4%
distribute-neg-in99.4%
metadata-eval99.4%
+-commutative99.4%
sub-neg99.4%
rem-square-sqrt46.8%
fabs-sqr46.8%
rem-square-sqrt48.0%
distribute-frac-neg248.0%
distribute-frac-neg48.0%
neg-sub048.0%
Simplified48.0%
Taylor expanded in x around 0 36.6%
(FPCore (x y z) :precision binary64 (if (<= x 2.0) (/ (- 4.0 x) y) (/ x y)))
double code(double x, double y, double z) {
double tmp;
if (x <= 2.0) {
tmp = (4.0 - x) / 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 <= 2.0d0) then
tmp = (4.0d0 - x) / 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 <= 2.0) {
tmp = (4.0 - x) / y;
} else {
tmp = x / y;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= 2.0: tmp = (4.0 - x) / y else: tmp = x / y return tmp
function code(x, y, z) tmp = 0.0 if (x <= 2.0) tmp = Float64(Float64(4.0 - x) / y); else tmp = Float64(x / y); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= 2.0) tmp = (4.0 - x) / y; else tmp = x / y; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 2.0], N[(N[(4.0 - x), $MachinePrecision] / y), $MachinePrecision], N[(x / y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 2:\\
\;\;\;\;\frac{4 - x}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\
\end{array}
\end{array}
if x < 2Initial program 91.9%
associate-*l/96.0%
sub-div98.5%
Applied egg-rr98.5%
add-sqr-sqrt48.8%
fabs-sqr48.8%
add-sqr-sqrt49.9%
frac-2neg49.9%
cancel-sign-sub-inv49.9%
*-commutative49.9%
distribute-neg-in49.9%
distribute-neg-in49.9%
add-sqr-sqrt33.9%
sqrt-unprod46.9%
sqr-neg46.9%
sqrt-unprod16.0%
add-sqr-sqrt53.1%
metadata-eval53.1%
distribute-rgt-neg-out53.1%
*-commutative53.1%
remove-double-neg53.1%
Applied egg-rr53.1%
*-commutative53.1%
add-sqr-sqrt25.1%
sqrt-unprod47.9%
sqr-neg47.9%
sqrt-unprod29.4%
add-sqr-sqrt48.1%
cancel-sign-sub-inv48.1%
Applied egg-rr48.1%
Taylor expanded in z around 0 39.4%
sub-neg39.4%
metadata-eval39.4%
neg-mul-139.4%
distribute-frac-neg39.4%
neg-sub039.4%
+-commutative39.4%
associate--r+39.4%
metadata-eval39.4%
Simplified39.4%
if 2 < x Initial program 84.4%
Simplified98.1%
Taylor expanded in y around 0 98.3%
mul-1-neg98.3%
+-commutative98.3%
distribute-neg-frac298.3%
fmm-def98.2%
distribute-neg-in98.2%
metadata-eval98.2%
+-commutative98.2%
sub-neg98.2%
rem-square-sqrt37.7%
fabs-sqr37.7%
rem-square-sqrt38.4%
distribute-frac-neg238.4%
distribute-frac-neg38.4%
neg-sub038.4%
Simplified38.4%
Taylor expanded in x around 0 33.1%
Taylor expanded in x around inf 31.9%
(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 91.9%
Simplified98.4%
Taylor expanded in y around 0 98.5%
mul-1-neg98.5%
+-commutative98.5%
distribute-neg-frac298.5%
fmm-def98.5%
distribute-neg-in98.5%
metadata-eval98.5%
+-commutative98.5%
sub-neg98.5%
rem-square-sqrt48.8%
fabs-sqr48.8%
rem-square-sqrt49.9%
distribute-frac-neg249.9%
distribute-frac-neg49.9%
neg-sub049.9%
Simplified49.9%
Taylor expanded in x around 0 26.9%
if 4 < x Initial program 84.4%
Simplified98.1%
Taylor expanded in y around 0 98.3%
mul-1-neg98.3%
+-commutative98.3%
distribute-neg-frac298.3%
fmm-def98.2%
distribute-neg-in98.2%
metadata-eval98.2%
+-commutative98.2%
sub-neg98.2%
rem-square-sqrt37.7%
fabs-sqr37.7%
rem-square-sqrt38.4%
distribute-frac-neg238.4%
distribute-frac-neg38.4%
neg-sub038.4%
Simplified38.4%
Taylor expanded in x around 0 33.1%
Taylor expanded in x around inf 31.9%
(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 90.2%
Simplified98.4%
Taylor expanded in y around 0 98.4%
mul-1-neg98.4%
+-commutative98.4%
distribute-neg-frac298.4%
fmm-def98.4%
distribute-neg-in98.4%
metadata-eval98.4%
+-commutative98.4%
sub-neg98.4%
rem-square-sqrt46.3%
fabs-sqr46.3%
rem-square-sqrt47.3%
distribute-frac-neg247.3%
distribute-frac-neg47.3%
neg-sub047.3%
Simplified47.3%
Taylor expanded in x around 0 21.6%
herbie shell --seed 2024188
(FPCore (x y z)
:name "fabs fraction 1"
:precision binary64
(fabs (- (/ (+ x 4.0) y) (* (/ x y) z))))