
(FPCore (x y z) :precision binary64 (/ (- x y) (- z y)))
double code(double x, double y, double z) {
return (x - y) / (z - 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 - y) / (z - y)
end function
public static double code(double x, double y, double z) {
return (x - y) / (z - y);
}
def code(x, y, z): return (x - y) / (z - y)
function code(x, y, z) return Float64(Float64(x - y) / Float64(z - y)) end
function tmp = code(x, y, z) tmp = (x - y) / (z - y); end
code[x_, y_, z_] := N[(N[(x - y), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x - y}{z - y}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 9 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z) :precision binary64 (/ (- x y) (- z y)))
double code(double x, double y, double z) {
return (x - y) / (z - 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 - y) / (z - y)
end function
public static double code(double x, double y, double z) {
return (x - y) / (z - y);
}
def code(x, y, z): return (x - y) / (z - y)
function code(x, y, z) return Float64(Float64(x - y) / Float64(z - y)) end
function tmp = code(x, y, z) tmp = (x - y) / (z - y); end
code[x_, y_, z_] := N[(N[(x - y), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x - y}{z - y}
\end{array}
(FPCore (x y z) :precision binary64 (+ (/ x (- z y)) (/ y (- y z))))
double code(double x, double y, double z) {
return (x / (z - y)) + (y / (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)) + (y / (y - z))
end function
public static double code(double x, double y, double z) {
return (x / (z - y)) + (y / (y - z));
}
def code(x, y, z): return (x / (z - y)) + (y / (y - z))
function code(x, y, z) return Float64(Float64(x / Float64(z - y)) + Float64(y / Float64(y - z))) end
function tmp = code(x, y, z) tmp = (x / (z - y)) + (y / (y - z)); end
code[x_, y_, z_] := N[(N[(x / N[(z - y), $MachinePrecision]), $MachinePrecision] + N[(y / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{z - y} + \frac{y}{y - z}
\end{array}
Initial program 100.0%
div-sub100.0%
Applied egg-rr100.0%
Final simplification100.0%
(FPCore (x y z)
:precision binary64
(if (<= y -7.5e+59)
1.0
(if (<= y -1.65e-25)
(/ (- y) z)
(if (<= y -1.55e-26)
1.0
(if (<= y 1.4e-136) (/ x z) (if (<= y 1.4e+125) (/ x (- y)) 1.0))))))
double code(double x, double y, double z) {
double tmp;
if (y <= -7.5e+59) {
tmp = 1.0;
} else if (y <= -1.65e-25) {
tmp = -y / z;
} else if (y <= -1.55e-26) {
tmp = 1.0;
} else if (y <= 1.4e-136) {
tmp = x / z;
} else if (y <= 1.4e+125) {
tmp = x / -y;
} else {
tmp = 1.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) :: tmp
if (y <= (-7.5d+59)) then
tmp = 1.0d0
else if (y <= (-1.65d-25)) then
tmp = -y / z
else if (y <= (-1.55d-26)) then
tmp = 1.0d0
else if (y <= 1.4d-136) then
tmp = x / z
else if (y <= 1.4d+125) then
tmp = x / -y
else
tmp = 1.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -7.5e+59) {
tmp = 1.0;
} else if (y <= -1.65e-25) {
tmp = -y / z;
} else if (y <= -1.55e-26) {
tmp = 1.0;
} else if (y <= 1.4e-136) {
tmp = x / z;
} else if (y <= 1.4e+125) {
tmp = x / -y;
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -7.5e+59: tmp = 1.0 elif y <= -1.65e-25: tmp = -y / z elif y <= -1.55e-26: tmp = 1.0 elif y <= 1.4e-136: tmp = x / z elif y <= 1.4e+125: tmp = x / -y else: tmp = 1.0 return tmp
function code(x, y, z) tmp = 0.0 if (y <= -7.5e+59) tmp = 1.0; elseif (y <= -1.65e-25) tmp = Float64(Float64(-y) / z); elseif (y <= -1.55e-26) tmp = 1.0; elseif (y <= 1.4e-136) tmp = Float64(x / z); elseif (y <= 1.4e+125) tmp = Float64(x / Float64(-y)); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -7.5e+59) tmp = 1.0; elseif (y <= -1.65e-25) tmp = -y / z; elseif (y <= -1.55e-26) tmp = 1.0; elseif (y <= 1.4e-136) tmp = x / z; elseif (y <= 1.4e+125) tmp = x / -y; else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -7.5e+59], 1.0, If[LessEqual[y, -1.65e-25], N[((-y) / z), $MachinePrecision], If[LessEqual[y, -1.55e-26], 1.0, If[LessEqual[y, 1.4e-136], N[(x / z), $MachinePrecision], If[LessEqual[y, 1.4e+125], N[(x / (-y)), $MachinePrecision], 1.0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7.5 \cdot 10^{+59}:\\
\;\;\;\;1\\
\mathbf{elif}\;y \leq -1.65 \cdot 10^{-25}:\\
\;\;\;\;\frac{-y}{z}\\
\mathbf{elif}\;y \leq -1.55 \cdot 10^{-26}:\\
\;\;\;\;1\\
\mathbf{elif}\;y \leq 1.4 \cdot 10^{-136}:\\
\;\;\;\;\frac{x}{z}\\
\mathbf{elif}\;y \leq 1.4 \cdot 10^{+125}:\\
\;\;\;\;\frac{x}{-y}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if y < -7.4999999999999996e59 or -1.6499999999999999e-25 < y < -1.54999999999999992e-26 or 1.4e125 < y Initial program 99.9%
Taylor expanded in y around inf 74.3%
if -7.4999999999999996e59 < y < -1.6499999999999999e-25Initial program 100.0%
Taylor expanded in z around inf 57.2%
Taylor expanded in x around 0 49.0%
neg-mul-149.0%
distribute-neg-frac249.0%
Simplified49.0%
if -1.54999999999999992e-26 < y < 1.4e-136Initial program 100.0%
Taylor expanded in y around 0 76.8%
if 1.4e-136 < y < 1.4e125Initial program 99.9%
Taylor expanded in x around inf 67.5%
Taylor expanded in z around 0 42.8%
mul-1-neg42.8%
distribute-frac-neg242.8%
Simplified42.8%
Final simplification66.5%
(FPCore (x y z) :precision binary64 (if (<= y -4e-26) 1.0 (if (<= y 3.35e-139) (/ x z) (if (<= y 4.8e+124) (/ x (- y)) 1.0))))
double code(double x, double y, double z) {
double tmp;
if (y <= -4e-26) {
tmp = 1.0;
} else if (y <= 3.35e-139) {
tmp = x / z;
} else if (y <= 4.8e+124) {
tmp = x / -y;
} else {
tmp = 1.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) :: tmp
if (y <= (-4d-26)) then
tmp = 1.0d0
else if (y <= 3.35d-139) then
tmp = x / z
else if (y <= 4.8d+124) then
tmp = x / -y
else
tmp = 1.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -4e-26) {
tmp = 1.0;
} else if (y <= 3.35e-139) {
tmp = x / z;
} else if (y <= 4.8e+124) {
tmp = x / -y;
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -4e-26: tmp = 1.0 elif y <= 3.35e-139: tmp = x / z elif y <= 4.8e+124: tmp = x / -y else: tmp = 1.0 return tmp
function code(x, y, z) tmp = 0.0 if (y <= -4e-26) tmp = 1.0; elseif (y <= 3.35e-139) tmp = Float64(x / z); elseif (y <= 4.8e+124) tmp = Float64(x / Float64(-y)); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -4e-26) tmp = 1.0; elseif (y <= 3.35e-139) tmp = x / z; elseif (y <= 4.8e+124) tmp = x / -y; else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -4e-26], 1.0, If[LessEqual[y, 3.35e-139], N[(x / z), $MachinePrecision], If[LessEqual[y, 4.8e+124], N[(x / (-y)), $MachinePrecision], 1.0]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4 \cdot 10^{-26}:\\
\;\;\;\;1\\
\mathbf{elif}\;y \leq 3.35 \cdot 10^{-139}:\\
\;\;\;\;\frac{x}{z}\\
\mathbf{elif}\;y \leq 4.8 \cdot 10^{+124}:\\
\;\;\;\;\frac{x}{-y}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if y < -4.0000000000000002e-26 or 4.80000000000000013e124 < y Initial program 100.0%
Taylor expanded in y around inf 65.5%
if -4.0000000000000002e-26 < y < 3.35e-139Initial program 100.0%
Taylor expanded in y around 0 76.8%
if 3.35e-139 < y < 4.80000000000000013e124Initial program 99.9%
Taylor expanded in x around inf 67.5%
Taylor expanded in z around 0 42.8%
mul-1-neg42.8%
distribute-frac-neg242.8%
Simplified42.8%
(FPCore (x y z) :precision binary64 (if (or (<= y -7e-26) (not (<= y 8e+38))) (/ y (- y z)) (/ x (- z y))))
double code(double x, double y, double z) {
double tmp;
if ((y <= -7e-26) || !(y <= 8e+38)) {
tmp = y / (y - z);
} else {
tmp = 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 ((y <= (-7d-26)) .or. (.not. (y <= 8d+38))) then
tmp = y / (y - z)
else
tmp = x / (z - y)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -7e-26) || !(y <= 8e+38)) {
tmp = y / (y - z);
} else {
tmp = x / (z - y);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -7e-26) or not (y <= 8e+38): tmp = y / (y - z) else: tmp = x / (z - y) return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -7e-26) || !(y <= 8e+38)) tmp = Float64(y / Float64(y - z)); else tmp = Float64(x / Float64(z - y)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -7e-26) || ~((y <= 8e+38))) tmp = y / (y - z); else tmp = x / (z - y); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -7e-26], N[Not[LessEqual[y, 8e+38]], $MachinePrecision]], N[(y / N[(y - z), $MachinePrecision]), $MachinePrecision], N[(x / N[(z - y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7 \cdot 10^{-26} \lor \neg \left(y \leq 8 \cdot 10^{+38}\right):\\
\;\;\;\;\frac{y}{y - z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z - y}\\
\end{array}
\end{array}
if y < -6.9999999999999997e-26 or 7.99999999999999982e38 < y Initial program 99.9%
Taylor expanded in x around 0 79.0%
neg-mul-179.0%
distribute-neg-frac79.0%
Simplified79.0%
frac-2neg79.0%
div-inv78.8%
remove-double-neg78.8%
sub-neg78.8%
distribute-neg-in78.8%
remove-double-neg78.8%
Applied egg-rr78.8%
associate-*r/79.0%
*-rgt-identity79.0%
+-commutative79.0%
unsub-neg79.0%
Simplified79.0%
if -6.9999999999999997e-26 < y < 7.99999999999999982e38Initial program 100.0%
Taylor expanded in x around inf 87.4%
Final simplification83.3%
(FPCore (x y z) :precision binary64 (if (or (<= y -6.2e-26) (not (<= y 4.8e+34))) (- 1.0 (/ x y)) (/ x (- z y))))
double code(double x, double y, double z) {
double tmp;
if ((y <= -6.2e-26) || !(y <= 4.8e+34)) {
tmp = 1.0 - (x / y);
} else {
tmp = 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 ((y <= (-6.2d-26)) .or. (.not. (y <= 4.8d+34))) then
tmp = 1.0d0 - (x / y)
else
tmp = x / (z - y)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -6.2e-26) || !(y <= 4.8e+34)) {
tmp = 1.0 - (x / y);
} else {
tmp = x / (z - y);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -6.2e-26) or not (y <= 4.8e+34): tmp = 1.0 - (x / y) else: tmp = x / (z - y) return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -6.2e-26) || !(y <= 4.8e+34)) tmp = Float64(1.0 - Float64(x / y)); else tmp = Float64(x / Float64(z - y)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -6.2e-26) || ~((y <= 4.8e+34))) tmp = 1.0 - (x / y); else tmp = x / (z - y); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -6.2e-26], N[Not[LessEqual[y, 4.8e+34]], $MachinePrecision]], N[(1.0 - N[(x / y), $MachinePrecision]), $MachinePrecision], N[(x / N[(z - y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.2 \cdot 10^{-26} \lor \neg \left(y \leq 4.8 \cdot 10^{+34}\right):\\
\;\;\;\;1 - \frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z - y}\\
\end{array}
\end{array}
if y < -6.19999999999999966e-26 or 4.79999999999999974e34 < y Initial program 100.0%
Taylor expanded in z around 0 74.4%
div-sub74.4%
sub-neg74.4%
*-inverses74.4%
metadata-eval74.4%
distribute-lft-in74.4%
metadata-eval74.4%
+-commutative74.4%
mul-1-neg74.4%
unsub-neg74.4%
Simplified74.4%
if -6.19999999999999966e-26 < y < 4.79999999999999974e34Initial program 100.0%
Taylor expanded in x around inf 87.3%
Final simplification81.0%
(FPCore (x y z) :precision binary64 (if (or (<= y -2.5e-28) (not (<= y 9.5e-137))) (- 1.0 (/ x y)) (/ x z)))
double code(double x, double y, double z) {
double tmp;
if ((y <= -2.5e-28) || !(y <= 9.5e-137)) {
tmp = 1.0 - (x / y);
} else {
tmp = x / z;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((y <= (-2.5d-28)) .or. (.not. (y <= 9.5d-137))) then
tmp = 1.0d0 - (x / y)
else
tmp = x / z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -2.5e-28) || !(y <= 9.5e-137)) {
tmp = 1.0 - (x / y);
} else {
tmp = x / z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -2.5e-28) or not (y <= 9.5e-137): tmp = 1.0 - (x / y) else: tmp = x / z return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -2.5e-28) || !(y <= 9.5e-137)) tmp = Float64(1.0 - Float64(x / y)); else tmp = Float64(x / z); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -2.5e-28) || ~((y <= 9.5e-137))) tmp = 1.0 - (x / y); else tmp = x / z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -2.5e-28], N[Not[LessEqual[y, 9.5e-137]], $MachinePrecision]], N[(1.0 - N[(x / y), $MachinePrecision]), $MachinePrecision], N[(x / z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.5 \cdot 10^{-28} \lor \neg \left(y \leq 9.5 \cdot 10^{-137}\right):\\
\;\;\;\;1 - \frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z}\\
\end{array}
\end{array}
if y < -2.5000000000000001e-28 or 9.5000000000000007e-137 < y Initial program 100.0%
Taylor expanded in z around 0 70.8%
div-sub70.8%
sub-neg70.8%
*-inverses70.8%
metadata-eval70.8%
distribute-lft-in70.8%
metadata-eval70.8%
+-commutative70.8%
mul-1-neg70.8%
unsub-neg70.8%
Simplified70.8%
if -2.5000000000000001e-28 < y < 9.5000000000000007e-137Initial program 100.0%
Taylor expanded in y around 0 76.8%
Final simplification73.0%
(FPCore (x y z) :precision binary64 (if (<= y -1.46e-27) 1.0 (if (<= y 1.4e+38) (/ x z) 1.0)))
double code(double x, double y, double z) {
double tmp;
if (y <= -1.46e-27) {
tmp = 1.0;
} else if (y <= 1.4e+38) {
tmp = x / z;
} else {
tmp = 1.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) :: tmp
if (y <= (-1.46d-27)) then
tmp = 1.0d0
else if (y <= 1.4d+38) then
tmp = x / z
else
tmp = 1.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -1.46e-27) {
tmp = 1.0;
} else if (y <= 1.4e+38) {
tmp = x / z;
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -1.46e-27: tmp = 1.0 elif y <= 1.4e+38: tmp = x / z else: tmp = 1.0 return tmp
function code(x, y, z) tmp = 0.0 if (y <= -1.46e-27) tmp = 1.0; elseif (y <= 1.4e+38) tmp = Float64(x / z); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -1.46e-27) tmp = 1.0; elseif (y <= 1.4e+38) tmp = x / z; else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -1.46e-27], 1.0, If[LessEqual[y, 1.4e+38], N[(x / z), $MachinePrecision], 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.46 \cdot 10^{-27}:\\
\;\;\;\;1\\
\mathbf{elif}\;y \leq 1.4 \cdot 10^{+38}:\\
\;\;\;\;\frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if y < -1.45999999999999992e-27 or 1.4e38 < y Initial program 99.9%
Taylor expanded in y around inf 60.0%
if -1.45999999999999992e-27 < y < 1.4e38Initial program 100.0%
Taylor expanded in y around 0 64.3%
(FPCore (x y z) :precision binary64 (/ (- x y) (- z y)))
double code(double x, double y, double z) {
return (x - y) / (z - 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 - y) / (z - y)
end function
public static double code(double x, double y, double z) {
return (x - y) / (z - y);
}
def code(x, y, z): return (x - y) / (z - y)
function code(x, y, z) return Float64(Float64(x - y) / Float64(z - y)) end
function tmp = code(x, y, z) tmp = (x - y) / (z - y); end
code[x_, y_, z_] := N[(N[(x - y), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x - y}{z - y}
\end{array}
Initial program 100.0%
(FPCore (x y z) :precision binary64 1.0)
double code(double x, double y, double z) {
return 1.0;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = 1.0d0
end function
public static double code(double x, double y, double z) {
return 1.0;
}
def code(x, y, z): return 1.0
function code(x, y, z) return 1.0 end
function tmp = code(x, y, z) tmp = 1.0; end
code[x_, y_, z_] := 1.0
\begin{array}{l}
\\
1
\end{array}
Initial program 100.0%
Taylor expanded in y around inf 33.8%
(FPCore (x y z) :precision binary64 (- (/ x (- z y)) (/ y (- z y))))
double code(double x, double y, double z) {
return (x / (z - y)) - (y / (z - 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 / (z - y)) - (y / (z - y))
end function
public static double code(double x, double y, double z) {
return (x / (z - y)) - (y / (z - y));
}
def code(x, y, z): return (x / (z - y)) - (y / (z - y))
function code(x, y, z) return Float64(Float64(x / Float64(z - y)) - Float64(y / Float64(z - y))) end
function tmp = code(x, y, z) tmp = (x / (z - y)) - (y / (z - y)); end
code[x_, y_, z_] := N[(N[(x / N[(z - y), $MachinePrecision]), $MachinePrecision] - N[(y / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{z - y} - \frac{y}{z - y}
\end{array}
herbie shell --seed 2024087
(FPCore (x y z)
:name "Graphics.Rasterific.Shading:$sgradientColorAt from Rasterific-0.6.1"
:precision binary64
:alt
(- (/ x (- z y)) (/ y (- z y)))
(/ (- x y) (- z y)))