\left(x \cdot y - z \cdot y\right) \cdot t
\begin{array}{l}
\mathbf{if}\;y \le 1.2427396531430804 \cdot 10^{-101}:\\
\;\;\;\;\mathsf{fma}\left(x, y, y \cdot \left(-z\right)\right) \cdot t\\
\mathbf{else}:\\
\;\;\;\;\left(t \cdot \left(x - z\right)\right) \cdot y\\
\end{array}double f(double x, double y, double z, double t) {
double r24617075 = x;
double r24617076 = y;
double r24617077 = r24617075 * r24617076;
double r24617078 = z;
double r24617079 = r24617078 * r24617076;
double r24617080 = r24617077 - r24617079;
double r24617081 = t;
double r24617082 = r24617080 * r24617081;
return r24617082;
}
double f(double x, double y, double z, double t) {
double r24617083 = y;
double r24617084 = 1.2427396531430804e-101;
bool r24617085 = r24617083 <= r24617084;
double r24617086 = x;
double r24617087 = z;
double r24617088 = -r24617087;
double r24617089 = r24617083 * r24617088;
double r24617090 = fma(r24617086, r24617083, r24617089);
double r24617091 = t;
double r24617092 = r24617090 * r24617091;
double r24617093 = r24617086 - r24617087;
double r24617094 = r24617091 * r24617093;
double r24617095 = r24617094 * r24617083;
double r24617096 = r24617085 ? r24617092 : r24617095;
return r24617096;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
| Original | 6.7 |
|---|---|
| Target | 3.0 |
| Herbie | 4.8 |
if y < 1.2427396531430804e-101Initial program 5.3
rmApplied fma-neg5.3
if 1.2427396531430804e-101 < y Initial program 10.3
rmApplied distribute-rgt-out--10.3
Applied associate-*l*3.5
Final simplification4.8
herbie shell --seed 2019164 +o rules:numerics
(FPCore (x y z t)
:name "Linear.Projection:inverseInfinitePerspective from linear-1.19.1.3"
:herbie-target
(if (< t -9.231879582886777e-80) (* (* y t) (- x z)) (if (< t 2.543067051564877e+83) (* y (* t (- x z))) (* (* y (- x z)) t)))
(* (- (* x y) (* z y)) t))