x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t}\begin{array}{l}
\mathbf{if}\;a \le -5.016302635808286517513557999404055653679 \cdot 10^{-145} \lor \neg \left(a \le 6.117509599976330539632063345610496487392 \cdot 10^{-206}\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 r411417 = x;
double r411418 = y;
double r411419 = r411418 - r411417;
double r411420 = z;
double r411421 = t;
double r411422 = r411420 - r411421;
double r411423 = r411419 * r411422;
double r411424 = a;
double r411425 = r411424 - r411421;
double r411426 = r411423 / r411425;
double r411427 = r411417 + r411426;
return r411427;
}
double f(double x, double y, double z, double t, double a) {
double r411428 = a;
double r411429 = -5.0163026358082865e-145;
bool r411430 = r411428 <= r411429;
double r411431 = 6.11750959997633e-206;
bool r411432 = r411428 <= r411431;
double r411433 = !r411432;
bool r411434 = r411430 || r411433;
double r411435 = y;
double r411436 = x;
double r411437 = r411435 - r411436;
double r411438 = z;
double r411439 = t;
double r411440 = r411438 - r411439;
double r411441 = r411428 - r411439;
double r411442 = r411440 / r411441;
double r411443 = fma(r411437, r411442, r411436);
double r411444 = r411436 / r411439;
double r411445 = r411438 * r411435;
double r411446 = r411445 / r411439;
double r411447 = r411435 - r411446;
double r411448 = fma(r411444, r411438, r411447);
double r411449 = r411434 ? r411443 : r411448;
return r411449;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t




Bits error versus a
| Original | 25.2 |
|---|---|
| Target | 9.6 |
| Herbie | 10.3 |
if a < -5.0163026358082865e-145 or 6.11750959997633e-206 < a Initial program 23.8
Simplified12.6
rmApplied fma-udef12.6
rmApplied div-inv12.7
Applied associate-*l*10.1
Simplified10.1
rmApplied fma-def10.1
if -5.0163026358082865e-145 < a < 6.11750959997633e-206Initial program 30.9
Simplified26.6
rmApplied fma-udef26.6
rmApplied div-inv26.7
Applied associate-*l*21.7
Simplified21.6
Taylor expanded around inf 11.2
Simplified11.2
Final simplification10.3
herbie shell --seed 2019323 +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))))