x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t}\begin{array}{l}
\mathbf{if}\;a \le 4.465064217535681631281470376504019940971 \cdot 10^{-300}:\\
\;\;\;\;\frac{z}{a - t} \cdot \left(y - x\right) + \mathsf{fma}\left(y - x, \frac{-t}{a - t}, x\right)\\
\mathbf{elif}\;a \le 1.512358371519834652214299708593704933811 \cdot 10^{-269}:\\
\;\;\;\;\mathsf{fma}\left(\frac{x}{t}, z, y - \frac{z \cdot y}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{a - t} \cdot \left(y - x\right) + \mathsf{fma}\left(y - x, \frac{-t}{a - t}, x\right)\\
\end{array}double f(double x, double y, double z, double t, double a) {
double r26533306 = x;
double r26533307 = y;
double r26533308 = r26533307 - r26533306;
double r26533309 = z;
double r26533310 = t;
double r26533311 = r26533309 - r26533310;
double r26533312 = r26533308 * r26533311;
double r26533313 = a;
double r26533314 = r26533313 - r26533310;
double r26533315 = r26533312 / r26533314;
double r26533316 = r26533306 + r26533315;
return r26533316;
}
double f(double x, double y, double z, double t, double a) {
double r26533317 = a;
double r26533318 = 4.4650642175356816e-300;
bool r26533319 = r26533317 <= r26533318;
double r26533320 = z;
double r26533321 = t;
double r26533322 = r26533317 - r26533321;
double r26533323 = r26533320 / r26533322;
double r26533324 = y;
double r26533325 = x;
double r26533326 = r26533324 - r26533325;
double r26533327 = r26533323 * r26533326;
double r26533328 = -r26533321;
double r26533329 = r26533328 / r26533322;
double r26533330 = fma(r26533326, r26533329, r26533325);
double r26533331 = r26533327 + r26533330;
double r26533332 = 1.5123583715198347e-269;
bool r26533333 = r26533317 <= r26533332;
double r26533334 = r26533325 / r26533321;
double r26533335 = r26533320 * r26533324;
double r26533336 = r26533335 / r26533321;
double r26533337 = r26533324 - r26533336;
double r26533338 = fma(r26533334, r26533320, r26533337);
double r26533339 = r26533333 ? r26533338 : r26533331;
double r26533340 = r26533319 ? r26533331 : r26533339;
return r26533340;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t




Bits error versus a
| Original | 24.4 |
|---|---|
| Target | 9.3 |
| Herbie | 8.7 |
if a < 4.4650642175356816e-300 or 1.5123583715198347e-269 < a Initial program 24.2
Simplified14.3
rmApplied fma-udef14.4
rmApplied div-inv14.4
Applied associate-*l*11.5
Simplified11.5
rmApplied div-sub11.5
rmApplied sub-neg11.5
Applied distribute-lft-in11.5
Applied associate-+l+8.7
Simplified8.7
if 4.4650642175356816e-300 < a < 1.5123583715198347e-269Initial program 33.8
Simplified28.1
rmApplied fma-udef28.2
rmApplied div-inv28.2
Applied associate-*l*24.1
Simplified24.1
Taylor expanded around inf 9.6
Simplified9.6
Final simplification8.7
herbie shell --seed 2019200 +o rules:numerics
(FPCore (x y z t a)
:name "Graphics.Rendering.Chart.Axis.Types:linMap from Chart-1.5.3"
:herbie-target
(if (< a -1.6153062845442575e-142) (+ x (* (/ (- y x) 1.0) (/ (- z t) (- a t)))) (if (< a 3.774403170083174e-182) (- y (* (/ z t) (- y x))) (+ x (* (/ (- y x) 1.0) (/ (- z t) (- a t))))))
(+ x (/ (* (- y x) (- z t)) (- a t))))