\left(x \cdot y - z \cdot y\right) \cdot t
\begin{array}{l}
\mathbf{if}\;t \leq -1.0358517492678618 \cdot 10^{+96} \lor \neg \left(t \leq 1.8279941513435347 \cdot 10^{-47}\right):\\
\;\;\;\;\left(x - z\right) \cdot \left(t \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(t \cdot x\right) - y \cdot \left(t \cdot z\right)\\
\end{array}(FPCore (x y z t) :precision binary64 (* (- (* x y) (* z y)) t))
(FPCore (x y z t) :precision binary64 (if (or (<= t -1.0358517492678618e+96) (not (<= t 1.8279941513435347e-47))) (* (- x z) (* t y)) (- (* y (* t x)) (* y (* t z)))))
double code(double x, double y, double z, double t) {
return ((x * y) - (z * y)) * t;
}
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -1.0358517492678618e+96) || !(t <= 1.8279941513435347e-47)) {
tmp = (x - z) * (t * y);
} else {
tmp = (y * (t * x)) - (y * (t * z));
}
return tmp;
}














Bits error versus x














Bits error versus y














Bits error versus z














Bits error versus t
Results
| Original | 6.9 |
|---|---|
| Target | 2.8 |
| Herbie | 2.9 |
| Alternative 1 | |
|---|---|
| Error | 2.9 |
| Cost | 776 |
| Alternative 2 | |
|---|---|
| Error | 7.2 |
| Cost | 776 |
| Alternative 3 | |
|---|---|
| Error | 19.9 |
| Cost | 1668 |
| Alternative 4 | |
|---|---|
| Error | 20.0 |
| Cost | 1668 |
| Alternative 5 | |
|---|---|
| Error | 19.7 |
| Cost | 1668 |
| Alternative 6 | |
|---|---|
| Error | 29.9 |
| Cost | 641 |
| Alternative 7 | |
|---|---|
| Error | 30.0 |
| Cost | 648 |
| Alternative 8 | |
|---|---|
| Error | 30.9 |
| Cost | 320 |
| Alternative 9 | |
|---|---|
| Error | 54.9 |
| Cost | 64 |
| Alternative 10 | |
|---|---|
| Error | 61.7 |
| Cost | 64 |

if t < -1.0358517492678618e96 or 1.8279941513435347e-47 < t Initial program 3.5
Simplified15.3
rmApplied associate-*r*_binary64_99074.1
Simplified4.1
if -1.0358517492678618e96 < t < 1.8279941513435347e-47Initial program 8.8
Simplified2.3
rmApplied sub-neg_binary64_99602.3
Applied distribute-rgt-in_binary64_99172.3
Applied distribute-rgt-in_binary64_99172.3
Simplified2.3
Simplified2.3
Simplified2.3
Final simplification2.9
herbie shell --seed 2021044
(FPCore (x y z t)
:name "Linear.Projection:inverseInfinitePerspective from linear-1.19.1.3"
:precision binary64
: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))