x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t}\begin{array}{l}
\mathbf{if}\;a \le -8.39805018372225709 \cdot 10^{-172} \lor \neg \left(a \le 4.96130980133353584 \cdot 10^{-246}\right):\\
\;\;\;\;\left(\left(z - t\right) \cdot \frac{1}{a - t}\right) \cdot y + \mathsf{fma}\left(-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 r908322 = x;
double r908323 = y;
double r908324 = r908323 - r908322;
double r908325 = z;
double r908326 = t;
double r908327 = r908325 - r908326;
double r908328 = r908324 * r908327;
double r908329 = a;
double r908330 = r908329 - r908326;
double r908331 = r908328 / r908330;
double r908332 = r908322 + r908331;
return r908332;
}
double f(double x, double y, double z, double t, double a) {
double r908333 = a;
double r908334 = -8.398050183722257e-172;
bool r908335 = r908333 <= r908334;
double r908336 = 4.961309801333536e-246;
bool r908337 = r908333 <= r908336;
double r908338 = !r908337;
bool r908339 = r908335 || r908338;
double r908340 = z;
double r908341 = t;
double r908342 = r908340 - r908341;
double r908343 = 1.0;
double r908344 = r908333 - r908341;
double r908345 = r908343 / r908344;
double r908346 = r908342 * r908345;
double r908347 = y;
double r908348 = r908346 * r908347;
double r908349 = x;
double r908350 = -r908349;
double r908351 = r908342 / r908344;
double r908352 = fma(r908350, r908351, r908349);
double r908353 = r908348 + r908352;
double r908354 = r908349 / r908341;
double r908355 = r908340 * r908347;
double r908356 = r908355 / r908341;
double r908357 = r908347 - r908356;
double r908358 = fma(r908354, r908340, r908357);
double r908359 = r908339 ? r908353 : r908358;
return r908359;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t




Bits error versus a
| Original | 24.2 |
|---|---|
| Target | 9.2 |
| Herbie | 7.4 |
if a < -8.398050183722257e-172 or 4.961309801333536e-246 < a Initial program 23.1
Simplified12.9
rmApplied div-sub12.9
rmApplied div-inv12.9
rmApplied fma-udef13.0
Simplified10.3
rmApplied sub-neg10.3
Applied distribute-lft-in10.3
Applied associate-+l+7.6
Simplified6.9
if -8.398050183722257e-172 < a < 4.961309801333536e-246Initial program 31.0
Simplified25.3
rmApplied div-sub25.3
rmApplied div-inv25.3
rmApplied fma-udef25.3
Simplified19.7
Taylor expanded around inf 12.1
Simplified10.8
Final simplification7.4
herbie shell --seed 2020034 +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))))