x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t}\begin{array}{l}
\mathbf{if}\;a \le -9.2462805926943716 \cdot 10^{-147}:\\
\;\;\;\;\mathsf{fma}\left(y - x, \left(z - t\right) \cdot \frac{1}{a - t}, x\right)\\
\mathbf{elif}\;a \le 1.76670232979846179 \cdot 10^{-149}:\\
\;\;\;\;\mathsf{fma}\left(\frac{x}{t}, z, y - \frac{z \cdot y}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y - x, \frac{z - t}{a - t}, x\right)\\
\end{array}double f(double x, double y, double z, double t, double a) {
double r581664 = x;
double r581665 = y;
double r581666 = r581665 - r581664;
double r581667 = z;
double r581668 = t;
double r581669 = r581667 - r581668;
double r581670 = r581666 * r581669;
double r581671 = a;
double r581672 = r581671 - r581668;
double r581673 = r581670 / r581672;
double r581674 = r581664 + r581673;
return r581674;
}
double f(double x, double y, double z, double t, double a) {
double r581675 = a;
double r581676 = -9.246280592694372e-147;
bool r581677 = r581675 <= r581676;
double r581678 = y;
double r581679 = x;
double r581680 = r581678 - r581679;
double r581681 = z;
double r581682 = t;
double r581683 = r581681 - r581682;
double r581684 = 1.0;
double r581685 = r581675 - r581682;
double r581686 = r581684 / r581685;
double r581687 = r581683 * r581686;
double r581688 = fma(r581680, r581687, r581679);
double r581689 = 1.7667023297984618e-149;
bool r581690 = r581675 <= r581689;
double r581691 = r581679 / r581682;
double r581692 = r581681 * r581678;
double r581693 = r581692 / r581682;
double r581694 = r581678 - r581693;
double r581695 = fma(r581691, r581681, r581694);
double r581696 = r581683 / r581685;
double r581697 = fma(r581680, r581696, r581679);
double r581698 = r581690 ? r581695 : r581697;
double r581699 = r581677 ? r581688 : r581698;
return r581699;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t




Bits error versus a
| Original | 25.0 |
|---|---|
| Target | 9.7 |
| Herbie | 10.6 |
if a < -9.246280592694372e-147Initial program 23.6
Simplified12.3
rmApplied fma-udef12.4
rmApplied div-inv12.5
Applied associate-*l*10.0
Simplified10.0
rmApplied fma-def10.0
rmApplied div-inv10.0
if -9.246280592694372e-147 < a < 1.7667023297984618e-149Initial program 29.6
Simplified25.0
rmApplied fma-udef25.0
rmApplied div-inv25.1
Applied associate-*l*19.8
Simplified19.7
Taylor expanded around inf 13.6
Simplified13.0
if 1.7667023297984618e-149 < a Initial program 23.6
Simplified11.8
rmApplied fma-udef11.9
rmApplied div-inv12.0
Applied associate-*l*9.6
Simplified9.6
rmApplied fma-def9.6
Final simplification10.6
herbie shell --seed 2020081 +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.774403170083174e-182) (- y (* (/ z t) (- y x))) (+ x (* (/ (- y x) 1) (/ (- z t) (- a t))))))
(+ x (/ (* (- y x) (- z t)) (- a t))))