\frac{x \cdot 2}{y \cdot z - t \cdot z}\begin{array}{l}
\mathbf{if}\;\frac{x \cdot 2}{y \cdot z - t \cdot z} \le -5.966470809942352604280748168933341651291 \cdot 10^{-251}:\\
\;\;\;\;\frac{x \cdot 2}{y \cdot z - t \cdot z}\\
\mathbf{elif}\;\frac{x \cdot 2}{y \cdot z - t \cdot z} \le -0.0:\\
\;\;\;\;\frac{\frac{x \cdot 2}{z}}{y - t}\\
\mathbf{elif}\;\frac{x \cdot 2}{y \cdot z - t \cdot z} \le 7.820034338024703644392920985462361112803 \cdot 10^{269}:\\
\;\;\;\;\frac{x \cdot 2}{y \cdot z - t \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{2}{y - t}}{\frac{z}{x}}\\
\end{array}double f(double x, double y, double z, double t) {
double r479087 = x;
double r479088 = 2.0;
double r479089 = r479087 * r479088;
double r479090 = y;
double r479091 = z;
double r479092 = r479090 * r479091;
double r479093 = t;
double r479094 = r479093 * r479091;
double r479095 = r479092 - r479094;
double r479096 = r479089 / r479095;
return r479096;
}
double f(double x, double y, double z, double t) {
double r479097 = x;
double r479098 = 2.0;
double r479099 = r479097 * r479098;
double r479100 = y;
double r479101 = z;
double r479102 = r479100 * r479101;
double r479103 = t;
double r479104 = r479103 * r479101;
double r479105 = r479102 - r479104;
double r479106 = r479099 / r479105;
double r479107 = -5.9664708099423526e-251;
bool r479108 = r479106 <= r479107;
double r479109 = -0.0;
bool r479110 = r479106 <= r479109;
double r479111 = r479099 / r479101;
double r479112 = r479100 - r479103;
double r479113 = r479111 / r479112;
double r479114 = 7.820034338024704e+269;
bool r479115 = r479106 <= r479114;
double r479116 = r479098 / r479112;
double r479117 = r479101 / r479097;
double r479118 = r479116 / r479117;
double r479119 = r479115 ? r479106 : r479118;
double r479120 = r479110 ? r479113 : r479119;
double r479121 = r479108 ? r479106 : r479120;
return r479121;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 7.0 |
|---|---|
| Target | 2.0 |
| Herbie | 1.1 |
if (/ (* x 2.0) (- (* y z) (* t z))) < -5.9664708099423526e-251 or -0.0 < (/ (* x 2.0) (- (* y z) (* t z))) < 7.820034338024704e+269Initial program 1.0
if -5.9664708099423526e-251 < (/ (* x 2.0) (- (* y z) (* t z))) < -0.0Initial program 12.5
rmApplied clear-num13.0
Simplified13.0
rmApplied pow113.0
Applied pow113.0
Applied pow-prod-down13.0
Simplified13.0
rmApplied div-inv13.0
Applied add-cube-cbrt13.0
Applied times-frac12.5
Simplified11.4
Simplified11.4
rmApplied *-un-lft-identity11.4
Applied *-un-lft-identity11.4
Applied *-un-lft-identity11.4
Applied times-frac11.4
Applied times-frac11.4
Applied associate-*l*11.4
Simplified0.7
if 7.820034338024704e+269 < (/ (* x 2.0) (- (* y z) (* t z))) Initial program 49.0
rmApplied clear-num49.1
Simplified19.8
rmApplied times-frac7.3
Applied associate-/r*7.1
Simplified7.1
Final simplification1.1
herbie shell --seed 2019174
(FPCore (x y z t)
:name "Linear.Projection:infinitePerspective from linear-1.19.1.3, A"
:herbie-target
(if (< (/ (* x 2.0) (- (* y z) (* t z))) -2.559141628295061e-13) (* (/ x (* (- y t) z)) 2.0) (if (< (/ (* x 2.0) (- (* y z) (* t z))) 1.045027827330126e-269) (/ (* (/ x z) 2.0) (- y t)) (* (/ x (* (- y t) z)) 2.0)))
(/ (* x 2.0) (- (* y z) (* t z))))