x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t}\begin{array}{l}
\mathbf{if}\;a \le -3.837631489575142323676445148625338285472 \cdot 10^{-137} \lor \neg \left(a \le 2.321492769909060759567206188060644981178 \cdot 10^{-169}\right):\\
\;\;\;\;\mathsf{fma}\left(y - x, \left(z - t\right) \cdot \frac{1}{a - t}, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{x}{t}, z, y - \frac{z \cdot y}{t}\right)\\
\end{array}double f(double x, double y, double z, double t, double a) {
double r322669 = x;
double r322670 = y;
double r322671 = r322670 - r322669;
double r322672 = z;
double r322673 = t;
double r322674 = r322672 - r322673;
double r322675 = r322671 * r322674;
double r322676 = a;
double r322677 = r322676 - r322673;
double r322678 = r322675 / r322677;
double r322679 = r322669 + r322678;
return r322679;
}
double f(double x, double y, double z, double t, double a) {
double r322680 = a;
double r322681 = -3.8376314895751423e-137;
bool r322682 = r322680 <= r322681;
double r322683 = 2.3214927699090608e-169;
bool r322684 = r322680 <= r322683;
double r322685 = !r322684;
bool r322686 = r322682 || r322685;
double r322687 = y;
double r322688 = x;
double r322689 = r322687 - r322688;
double r322690 = z;
double r322691 = t;
double r322692 = r322690 - r322691;
double r322693 = 1.0;
double r322694 = r322680 - r322691;
double r322695 = r322693 / r322694;
double r322696 = r322692 * r322695;
double r322697 = fma(r322689, r322696, r322688);
double r322698 = r322688 / r322691;
double r322699 = r322690 * r322687;
double r322700 = r322699 / r322691;
double r322701 = r322687 - r322700;
double r322702 = fma(r322698, r322690, r322701);
double r322703 = r322686 ? r322697 : r322702;
return r322703;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t




Bits error versus a
| Original | 24.7 |
|---|---|
| Target | 9.6 |
| Herbie | 10.4 |
if a < -3.8376314895751423e-137 or 2.3214927699090608e-169 < a Initial program 23.6
Simplified11.9
rmApplied fma-udef11.9
rmApplied div-inv12.0
Applied associate-*l*9.8
Simplified9.8
rmApplied fma-def9.8
rmApplied div-inv9.8
if -3.8376314895751423e-137 < a < 2.3214927699090608e-169Initial program 28.5
Simplified24.1
rmApplied fma-udef24.2
rmApplied div-inv24.2
Applied associate-*l*19.0
Simplified18.9
Taylor expanded around inf 13.8
Simplified12.6
Final simplification10.4
herbie shell --seed 2019212 +o rules:numerics
(FPCore (x y z t a)
:name "Graphics.Rendering.Chart.Axis.Types:linMap from Chart-1.5.3"
:precision binary64
:herbie-target
(if (< a -1.6153062845442575e-142) (+ x (* (/ (- y x) 1) (/ (- z t) (- a t)))) (if (< a 3.7744031700831742e-182) (- y (* (/ z t) (- y x))) (+ x (* (/ (- y x) 1) (/ (- z t) (- a t))))))
(+ x (/ (* (- y x) (- z t)) (- a t))))