x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t}\begin{array}{l}
\mathbf{if}\;a \le -1.322021561305451746656429473091041729273 \cdot 10^{-228}:\\
\;\;\;\;\left(y - x\right) \cdot \frac{z - t}{a - t} + x\\
\mathbf{elif}\;a \le 1.474978086208166197165144421451213606011 \cdot 10^{-72}:\\
\;\;\;\;\mathsf{fma}\left(\frac{x}{t}, z, y - \frac{z \cdot y}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(y - x\right) \cdot \left(\left(z - t\right) \cdot \frac{1}{a - t}\right) + x\\
\end{array}double f(double x, double y, double z, double t, double a) {
double r500086 = x;
double r500087 = y;
double r500088 = r500087 - r500086;
double r500089 = z;
double r500090 = t;
double r500091 = r500089 - r500090;
double r500092 = r500088 * r500091;
double r500093 = a;
double r500094 = r500093 - r500090;
double r500095 = r500092 / r500094;
double r500096 = r500086 + r500095;
return r500096;
}
double f(double x, double y, double z, double t, double a) {
double r500097 = a;
double r500098 = -1.3220215613054517e-228;
bool r500099 = r500097 <= r500098;
double r500100 = y;
double r500101 = x;
double r500102 = r500100 - r500101;
double r500103 = z;
double r500104 = t;
double r500105 = r500103 - r500104;
double r500106 = r500097 - r500104;
double r500107 = r500105 / r500106;
double r500108 = r500102 * r500107;
double r500109 = r500108 + r500101;
double r500110 = 1.4749780862081662e-72;
bool r500111 = r500097 <= r500110;
double r500112 = r500101 / r500104;
double r500113 = r500103 * r500100;
double r500114 = r500113 / r500104;
double r500115 = r500100 - r500114;
double r500116 = fma(r500112, r500103, r500115);
double r500117 = 1.0;
double r500118 = r500117 / r500106;
double r500119 = r500105 * r500118;
double r500120 = r500102 * r500119;
double r500121 = r500120 + r500101;
double r500122 = r500111 ? r500116 : r500121;
double r500123 = r500099 ? r500109 : r500122;
return r500123;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t




Bits error versus a
| Original | 24.3 |
|---|---|
| Target | 9.5 |
| Herbie | 10.8 |
if a < -1.3220215613054517e-228Initial program 23.4
Simplified13.5
rmApplied fma-udef13.6
rmApplied div-inv13.6
Applied associate-*l*10.9
Simplified10.8
if -1.3220215613054517e-228 < a < 1.4749780862081662e-72Initial program 29.5
Simplified24.7
rmApplied fma-udef24.7
rmApplied div-inv24.8
Applied associate-*l*20.4
Simplified20.3
Taylor expanded around inf 15.4
Simplified14.9
if 1.4749780862081662e-72 < a Initial program 21.9
Simplified9.8
rmApplied fma-udef9.9
rmApplied div-inv10.0
Applied associate-*l*8.0
Simplified7.9
rmApplied div-inv8.0
Final simplification10.8
herbie shell --seed 2019326 +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))))