
(FPCore (x y z) :precision binary64 (/ (* x (+ y z)) z))
double code(double x, double y, double z) {
return (x * (y + z)) / z;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = (x * (y + z)) / z
end function
public static double code(double x, double y, double z) {
return (x * (y + z)) / z;
}
def code(x, y, z): return (x * (y + z)) / z
function code(x, y, z) return Float64(Float64(x * Float64(y + z)) / z) end
function tmp = code(x, y, z) tmp = (x * (y + z)) / z; end
code[x_, y_, z_] := N[(N[(x * N[(y + z), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot \left(y + z\right)}{z}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 9 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z) :precision binary64 (/ (* x (+ y z)) z))
double code(double x, double y, double z) {
return (x * (y + z)) / z;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = (x * (y + z)) / z
end function
public static double code(double x, double y, double z) {
return (x * (y + z)) / z;
}
def code(x, y, z): return (x * (y + z)) / z
function code(x, y, z) return Float64(Float64(x * Float64(y + z)) / z) end
function tmp = code(x, y, z) tmp = (x * (y + z)) / z; end
code[x_, y_, z_] := N[(N[(x * N[(y + z), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot \left(y + z\right)}{z}
\end{array}
(FPCore (x y z) :precision binary64 (if (<= y -1.95e+73) (/ (* x (+ y z)) z) (fma x (/ y z) x)))
double code(double x, double y, double z) {
double tmp;
if (y <= -1.95e+73) {
tmp = (x * (y + z)) / z;
} else {
tmp = fma(x, (y / z), x);
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (y <= -1.95e+73) tmp = Float64(Float64(x * Float64(y + z)) / z); else tmp = fma(x, Float64(y / z), x); end return tmp end
code[x_, y_, z_] := If[LessEqual[y, -1.95e+73], N[(N[(x * N[(y + z), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], N[(x * N[(y / z), $MachinePrecision] + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.95 \cdot 10^{+73}:\\
\;\;\;\;\frac{x \cdot \left(y + z\right)}{z}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x, \frac{y}{z}, x\right)\\
\end{array}
\end{array}
if y < -1.95e73Initial program 97.2%
if -1.95e73 < y Initial program 87.8%
associate-*l/81.1%
distribute-rgt-in76.8%
associate-*r/72.6%
*-commutative72.6%
associate-*r/76.1%
associate-*r/89.3%
associate-/l*76.4%
associate-/r/97.7%
*-inverses97.7%
*-lft-identity97.7%
fma-def97.7%
Simplified97.7%
Final simplification97.6%
(FPCore (x y z)
:precision binary64
(if (or (<= y -1.1e-42)
(not (or (<= y 2.8e-86) (and (not (<= y 5.1e-46)) (<= y 3800.0)))))
(* x (/ y z))
x))
double code(double x, double y, double z) {
double tmp;
if ((y <= -1.1e-42) || !((y <= 2.8e-86) || (!(y <= 5.1e-46) && (y <= 3800.0)))) {
tmp = x * (y / z);
} else {
tmp = 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 ((y <= (-1.1d-42)) .or. (.not. (y <= 2.8d-86) .or. (.not. (y <= 5.1d-46)) .and. (y <= 3800.0d0))) then
tmp = x * (y / z)
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -1.1e-42) || !((y <= 2.8e-86) || (!(y <= 5.1e-46) && (y <= 3800.0)))) {
tmp = x * (y / z);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -1.1e-42) or not ((y <= 2.8e-86) or (not (y <= 5.1e-46) and (y <= 3800.0))): tmp = x * (y / z) else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -1.1e-42) || !((y <= 2.8e-86) || (!(y <= 5.1e-46) && (y <= 3800.0)))) tmp = Float64(x * Float64(y / z)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -1.1e-42) || ~(((y <= 2.8e-86) || (~((y <= 5.1e-46)) && (y <= 3800.0))))) tmp = x * (y / z); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -1.1e-42], N[Not[Or[LessEqual[y, 2.8e-86], And[N[Not[LessEqual[y, 5.1e-46]], $MachinePrecision], LessEqual[y, 3800.0]]]], $MachinePrecision]], N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.1 \cdot 10^{-42} \lor \neg \left(y \leq 2.8 \cdot 10^{-86} \lor \neg \left(y \leq 5.1 \cdot 10^{-46}\right) \land y \leq 3800\right):\\
\;\;\;\;x \cdot \frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -1.10000000000000003e-42 or 2.80000000000000009e-86 < y < 5.0999999999999997e-46 or 3800 < y Initial program 95.1%
associate-/l*91.8%
Simplified91.8%
Taylor expanded in z around 0 80.0%
associate-*r/74.3%
Simplified74.3%
if -1.10000000000000003e-42 < y < 2.80000000000000009e-86 or 5.0999999999999997e-46 < y < 3800Initial program 82.1%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in z around inf 78.9%
Final simplification76.4%
(FPCore (x y z)
:precision binary64
(if (or (<= y -3.4e-41)
(not (or (<= y 2.7e-80) (and (not (<= y 8.5e-45)) (<= y 6600.0)))))
(/ (* y x) z)
x))
double code(double x, double y, double z) {
double tmp;
if ((y <= -3.4e-41) || !((y <= 2.7e-80) || (!(y <= 8.5e-45) && (y <= 6600.0)))) {
tmp = (y * x) / z;
} else {
tmp = 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 ((y <= (-3.4d-41)) .or. (.not. (y <= 2.7d-80) .or. (.not. (y <= 8.5d-45)) .and. (y <= 6600.0d0))) then
tmp = (y * x) / z
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -3.4e-41) || !((y <= 2.7e-80) || (!(y <= 8.5e-45) && (y <= 6600.0)))) {
tmp = (y * x) / z;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -3.4e-41) or not ((y <= 2.7e-80) or (not (y <= 8.5e-45) and (y <= 6600.0))): tmp = (y * x) / z else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -3.4e-41) || !((y <= 2.7e-80) || (!(y <= 8.5e-45) && (y <= 6600.0)))) tmp = Float64(Float64(y * x) / z); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -3.4e-41) || ~(((y <= 2.7e-80) || (~((y <= 8.5e-45)) && (y <= 6600.0))))) tmp = (y * x) / z; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -3.4e-41], N[Not[Or[LessEqual[y, 2.7e-80], And[N[Not[LessEqual[y, 8.5e-45]], $MachinePrecision], LessEqual[y, 6600.0]]]], $MachinePrecision]], N[(N[(y * x), $MachinePrecision] / z), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.4 \cdot 10^{-41} \lor \neg \left(y \leq 2.7 \cdot 10^{-80} \lor \neg \left(y \leq 8.5 \cdot 10^{-45}\right) \land y \leq 6600\right):\\
\;\;\;\;\frac{y \cdot x}{z}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -3.3999999999999998e-41 or 2.7000000000000002e-80 < y < 8.50000000000000041e-45 or 6600 < y Initial program 95.1%
associate-/l*91.8%
Simplified91.8%
Taylor expanded in z around 0 80.0%
if -3.3999999999999998e-41 < y < 2.7000000000000002e-80 or 8.50000000000000041e-45 < y < 6600Initial program 82.1%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in z around inf 78.9%
Final simplification79.5%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* y (/ x z))))
(if (<= y -3.3e-43)
t_0
(if (<= y 2.2e-78)
x
(if (<= y 4.2e-46) (* x (/ y z)) (if (<= y 9500.0) x t_0))))))
double code(double x, double y, double z) {
double t_0 = y * (x / z);
double tmp;
if (y <= -3.3e-43) {
tmp = t_0;
} else if (y <= 2.2e-78) {
tmp = x;
} else if (y <= 4.2e-46) {
tmp = x * (y / z);
} else if (y <= 9500.0) {
tmp = x;
} 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 = y * (x / z)
if (y <= (-3.3d-43)) then
tmp = t_0
else if (y <= 2.2d-78) then
tmp = x
else if (y <= 4.2d-46) then
tmp = x * (y / z)
else if (y <= 9500.0d0) then
tmp = x
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = y * (x / z);
double tmp;
if (y <= -3.3e-43) {
tmp = t_0;
} else if (y <= 2.2e-78) {
tmp = x;
} else if (y <= 4.2e-46) {
tmp = x * (y / z);
} else if (y <= 9500.0) {
tmp = x;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = y * (x / z) tmp = 0 if y <= -3.3e-43: tmp = t_0 elif y <= 2.2e-78: tmp = x elif y <= 4.2e-46: tmp = x * (y / z) elif y <= 9500.0: tmp = x else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(y * Float64(x / z)) tmp = 0.0 if (y <= -3.3e-43) tmp = t_0; elseif (y <= 2.2e-78) tmp = x; elseif (y <= 4.2e-46) tmp = Float64(x * Float64(y / z)); elseif (y <= 9500.0) tmp = x; else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = y * (x / z); tmp = 0.0; if (y <= -3.3e-43) tmp = t_0; elseif (y <= 2.2e-78) tmp = x; elseif (y <= 4.2e-46) tmp = x * (y / z); elseif (y <= 9500.0) tmp = x; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -3.3e-43], t$95$0, If[LessEqual[y, 2.2e-78], x, If[LessEqual[y, 4.2e-46], N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 9500.0], x, t$95$0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y \cdot \frac{x}{z}\\
\mathbf{if}\;y \leq -3.3 \cdot 10^{-43}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq 2.2 \cdot 10^{-78}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 4.2 \cdot 10^{-46}:\\
\;\;\;\;x \cdot \frac{y}{z}\\
\mathbf{elif}\;y \leq 9500:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if y < -3.30000000000000016e-43 or 9500 < y Initial program 94.8%
associate-/l*91.4%
Simplified91.4%
Taylor expanded in z around 0 79.5%
*-commutative79.5%
associate-*r/77.1%
Simplified77.1%
if -3.30000000000000016e-43 < y < 2.1999999999999999e-78 or 4.19999999999999975e-46 < y < 9500Initial program 82.1%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in z around inf 78.9%
if 2.1999999999999999e-78 < y < 4.19999999999999975e-46Initial program 100.0%
associate-/l*99.6%
Simplified99.6%
Taylor expanded in z around 0 88.1%
associate-*r/87.9%
Simplified87.9%
Final simplification78.3%
(FPCore (x y z)
:precision binary64
(if (<= y -7.8e-41)
(* y (/ x z))
(if (<= y 2.45e-79)
x
(if (<= y 3.4e-45) (* x (/ y z)) (if (<= y 14500.0) x (/ y (/ z x)))))))
double code(double x, double y, double z) {
double tmp;
if (y <= -7.8e-41) {
tmp = y * (x / z);
} else if (y <= 2.45e-79) {
tmp = x;
} else if (y <= 3.4e-45) {
tmp = x * (y / z);
} else if (y <= 14500.0) {
tmp = x;
} else {
tmp = y / (z / 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 (y <= (-7.8d-41)) then
tmp = y * (x / z)
else if (y <= 2.45d-79) then
tmp = x
else if (y <= 3.4d-45) then
tmp = x * (y / z)
else if (y <= 14500.0d0) then
tmp = x
else
tmp = y / (z / x)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -7.8e-41) {
tmp = y * (x / z);
} else if (y <= 2.45e-79) {
tmp = x;
} else if (y <= 3.4e-45) {
tmp = x * (y / z);
} else if (y <= 14500.0) {
tmp = x;
} else {
tmp = y / (z / x);
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -7.8e-41: tmp = y * (x / z) elif y <= 2.45e-79: tmp = x elif y <= 3.4e-45: tmp = x * (y / z) elif y <= 14500.0: tmp = x else: tmp = y / (z / x) return tmp
function code(x, y, z) tmp = 0.0 if (y <= -7.8e-41) tmp = Float64(y * Float64(x / z)); elseif (y <= 2.45e-79) tmp = x; elseif (y <= 3.4e-45) tmp = Float64(x * Float64(y / z)); elseif (y <= 14500.0) tmp = x; else tmp = Float64(y / Float64(z / x)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -7.8e-41) tmp = y * (x / z); elseif (y <= 2.45e-79) tmp = x; elseif (y <= 3.4e-45) tmp = x * (y / z); elseif (y <= 14500.0) tmp = x; else tmp = y / (z / x); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -7.8e-41], N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.45e-79], x, If[LessEqual[y, 3.4e-45], N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 14500.0], x, N[(y / N[(z / x), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7.8 \cdot 10^{-41}:\\
\;\;\;\;y \cdot \frac{x}{z}\\
\mathbf{elif}\;y \leq 2.45 \cdot 10^{-79}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 3.4 \cdot 10^{-45}:\\
\;\;\;\;x \cdot \frac{y}{z}\\
\mathbf{elif}\;y \leq 14500:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{\frac{z}{x}}\\
\end{array}
\end{array}
if y < -7.79999999999999982e-41Initial program 96.6%
associate-/l*89.3%
Simplified89.3%
Taylor expanded in z around 0 83.8%
*-commutative83.8%
associate-*r/79.0%
Simplified79.0%
if -7.79999999999999982e-41 < y < 2.45e-79 or 3.40000000000000004e-45 < y < 14500Initial program 82.1%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in z around inf 78.9%
if 2.45e-79 < y < 3.40000000000000004e-45Initial program 100.0%
associate-/l*99.6%
Simplified99.6%
Taylor expanded in z around 0 88.1%
associate-*r/87.9%
Simplified87.9%
if 14500 < y Initial program 93.2%
associate-/l*93.2%
Simplified93.2%
Taylor expanded in z around 0 75.8%
*-commutative75.8%
associate-*r/75.5%
Simplified75.5%
clear-num75.4%
un-div-inv75.5%
Applied egg-rr75.5%
Final simplification78.3%
(FPCore (x y z) :precision binary64 (if (<= y -2.55e+73) (/ (* x (+ y z)) z) (* x (/ (+ y z) z))))
double code(double x, double y, double z) {
double tmp;
if (y <= -2.55e+73) {
tmp = (x * (y + z)) / z;
} else {
tmp = x * ((y + z) / 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 (y <= (-2.55d+73)) then
tmp = (x * (y + z)) / z
else
tmp = x * ((y + z) / z)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -2.55e+73) {
tmp = (x * (y + z)) / z;
} else {
tmp = x * ((y + z) / z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -2.55e+73: tmp = (x * (y + z)) / z else: tmp = x * ((y + z) / z) return tmp
function code(x, y, z) tmp = 0.0 if (y <= -2.55e+73) tmp = Float64(Float64(x * Float64(y + z)) / z); else tmp = Float64(x * Float64(Float64(y + z) / z)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -2.55e+73) tmp = (x * (y + z)) / z; else tmp = x * ((y + z) / z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -2.55e+73], N[(N[(x * N[(y + z), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], N[(x * N[(N[(y + z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.55 \cdot 10^{+73}:\\
\;\;\;\;\frac{x \cdot \left(y + z\right)}{z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{y + z}{z}\\
\end{array}
\end{array}
if y < -2.55000000000000012e73Initial program 97.2%
if -2.55000000000000012e73 < y Initial program 87.8%
associate-*r/97.7%
Simplified97.7%
Final simplification97.6%
(FPCore (x y z) :precision binary64 (* x (/ (+ y z) z)))
double code(double x, double y, double z) {
return x * ((y + z) / z);
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x * ((y + z) / z)
end function
public static double code(double x, double y, double z) {
return x * ((y + z) / z);
}
def code(x, y, z): return x * ((y + z) / z)
function code(x, y, z) return Float64(x * Float64(Float64(y + z) / z)) end
function tmp = code(x, y, z) tmp = x * ((y + z) / z); end
code[x_, y_, z_] := N[(x * N[(N[(y + z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \frac{y + z}{z}
\end{array}
Initial program 89.2%
associate-*r/95.4%
Simplified95.4%
Final simplification95.4%
(FPCore (x y z) :precision binary64 (/ x (/ z (+ y z))))
double code(double x, double y, double z) {
return x / (z / (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 = x / (z / (y + z))
end function
public static double code(double x, double y, double z) {
return x / (z / (y + z));
}
def code(x, y, z): return x / (z / (y + z))
function code(x, y, z) return Float64(x / Float64(z / Float64(y + z))) end
function tmp = code(x, y, z) tmp = x / (z / (y + z)); end
code[x_, y_, z_] := N[(x / N[(z / N[(y + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{\frac{z}{y + z}}
\end{array}
Initial program 89.2%
associate-/l*95.5%
Simplified95.5%
Final simplification95.5%
(FPCore (x y z) :precision binary64 x)
double code(double x, double y, double z) {
return x;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x
end function
public static double code(double x, double y, double z) {
return x;
}
def code(x, y, z): return x
function code(x, y, z) return x end
function tmp = code(x, y, z) tmp = x; end
code[x_, y_, z_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 89.2%
associate-/l*95.5%
Simplified95.5%
Taylor expanded in z around inf 46.5%
Final simplification46.5%
(FPCore (x y z) :precision binary64 (/ x (/ z (+ y z))))
double code(double x, double y, double z) {
return x / (z / (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 = x / (z / (y + z))
end function
public static double code(double x, double y, double z) {
return x / (z / (y + z));
}
def code(x, y, z): return x / (z / (y + z))
function code(x, y, z) return Float64(x / Float64(z / Float64(y + z))) end
function tmp = code(x, y, z) tmp = x / (z / (y + z)); end
code[x_, y_, z_] := N[(x / N[(z / N[(y + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{\frac{z}{y + z}}
\end{array}
herbie shell --seed 2023301
(FPCore (x y z)
:name "Numeric.SpecFunctions:choose from math-functions-0.1.5.2"
:precision binary64
:herbie-target
(/ x (/ z (+ y z)))
(/ (* x (+ y z)) z))