\frac{x \cdot 2}{y \cdot z - t \cdot z}\begin{array}{l}
\mathbf{if}\;z \le -4.154512528065834 \cdot 10^{229} \lor \neg \left(z \le 9.1298419035993844 \cdot 10^{-77}\right):\\
\;\;\;\;{\left(\frac{\frac{x}{\frac{y - t}{2}}}{z}\right)}^{1}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{z}}{y - t} \cdot \frac{x}{\frac{1}{2}}\\
\end{array}double f(double x, double y, double z, double t) {
double r643225 = x;
double r643226 = 2.0;
double r643227 = r643225 * r643226;
double r643228 = y;
double r643229 = z;
double r643230 = r643228 * r643229;
double r643231 = t;
double r643232 = r643231 * r643229;
double r643233 = r643230 - r643232;
double r643234 = r643227 / r643233;
return r643234;
}
double f(double x, double y, double z, double t) {
double r643235 = z;
double r643236 = -4.154512528065834e+229;
bool r643237 = r643235 <= r643236;
double r643238 = 9.129841903599384e-77;
bool r643239 = r643235 <= r643238;
double r643240 = !r643239;
bool r643241 = r643237 || r643240;
double r643242 = x;
double r643243 = y;
double r643244 = t;
double r643245 = r643243 - r643244;
double r643246 = 2.0;
double r643247 = r643245 / r643246;
double r643248 = r643242 / r643247;
double r643249 = r643248 / r643235;
double r643250 = 1.0;
double r643251 = pow(r643249, r643250);
double r643252 = r643250 / r643235;
double r643253 = r643252 / r643245;
double r643254 = r643250 / r643246;
double r643255 = r643242 / r643254;
double r643256 = r643253 * r643255;
double r643257 = r643241 ? r643251 : r643256;
return r643257;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 6.8 |
|---|---|
| Target | 2.1 |
| Herbie | 3.5 |
if z < -4.154512528065834e+229 or 9.129841903599384e-77 < z Initial program 10.0
Simplified7.9
rmApplied *-un-lft-identity7.9
Applied times-frac7.9
Applied *-un-lft-identity7.9
Applied times-frac2.5
Simplified2.5
rmApplied pow12.5
Applied pow12.5
Applied pow-prod-down2.5
Simplified2.4
if -4.154512528065834e+229 < z < 9.129841903599384e-77Initial program 4.6
Simplified4.2
rmApplied *-un-lft-identity4.2
Applied times-frac4.2
Applied *-un-lft-identity4.2
Applied times-frac7.7
Simplified7.7
rmApplied div-inv7.7
Applied *-un-lft-identity7.7
Applied times-frac7.7
Applied associate-*r*4.3
Simplified4.2
Final simplification3.5
herbie shell --seed 2020027
(FPCore (x y z t)
:name "Linear.Projection:infinitePerspective from linear-1.19.1.3, A"
:precision binary64
:herbie-target
(if (< (/ (* x 2) (- (* y z) (* t z))) -2.559141628295061e-13) (* (/ x (* (- y t) z)) 2) (if (< (/ (* x 2) (- (* y z) (* t z))) 1.0450278273301259e-269) (/ (* (/ x z) 2) (- y t)) (* (/ x (* (- y t) z)) 2)))
(/ (* x 2) (- (* y z) (* t z))))