x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t}\begin{array}{l}
\mathbf{if}\;a \le -2.415857940976969603886528580327419405542 \cdot 10^{-58} \lor \neg \left(a \le 1.530202389351854798361295608077459079059 \cdot 10^{-220}\right):\\
\;\;\;\;\mathsf{fma}\left(y - x, \frac{z - t}{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 r513401 = x;
double r513402 = y;
double r513403 = r513402 - r513401;
double r513404 = z;
double r513405 = t;
double r513406 = r513404 - r513405;
double r513407 = r513403 * r513406;
double r513408 = a;
double r513409 = r513408 - r513405;
double r513410 = r513407 / r513409;
double r513411 = r513401 + r513410;
return r513411;
}
double f(double x, double y, double z, double t, double a) {
double r513412 = a;
double r513413 = -2.4158579409769696e-58;
bool r513414 = r513412 <= r513413;
double r513415 = 1.5302023893518548e-220;
bool r513416 = r513412 <= r513415;
double r513417 = !r513416;
bool r513418 = r513414 || r513417;
double r513419 = y;
double r513420 = x;
double r513421 = r513419 - r513420;
double r513422 = z;
double r513423 = t;
double r513424 = r513422 - r513423;
double r513425 = r513412 - r513423;
double r513426 = r513424 / r513425;
double r513427 = fma(r513421, r513426, r513420);
double r513428 = r513420 / r513423;
double r513429 = r513422 * r513419;
double r513430 = r513429 / r513423;
double r513431 = r513419 - r513430;
double r513432 = fma(r513428, r513422, r513431);
double r513433 = r513418 ? r513427 : r513432;
return r513433;
}




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.3 |
| Herbie | 10.8 |
if a < -2.4158579409769696e-58 or 1.5302023893518548e-220 < a Initial program 22.9
Simplified11.5
rmApplied fma-udef11.6
rmApplied div-inv11.6
Applied associate-*l*9.3
Simplified9.3
rmApplied fma-def9.2
if -2.4158579409769696e-58 < a < 1.5302023893518548e-220Initial program 28.6
Simplified24.1
rmApplied fma-udef24.1
rmApplied div-inv24.2
Applied associate-*l*19.9
Simplified19.8
Taylor expanded around inf 16.0
Simplified15.7
Final simplification10.8
herbie shell --seed 2019351 +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))))