x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t}\begin{array}{l}
\mathbf{if}\;a \le -1.573086372777872649310539157707014574793 \cdot 10^{-148}:\\
\;\;\;\;\left(y - x\right) \cdot \left(\left(z - t\right) \cdot \frac{1}{a - t}\right) + x\\
\mathbf{elif}\;a \le 1.831583919613879386678232165594971224481 \cdot 10^{-164}:\\
\;\;\;\;\mathsf{fma}\left(\frac{x}{t}, z, y - \frac{z \cdot y}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(y - x\right) \cdot \frac{z - t}{a - t} + x\\
\end{array}double f(double x, double y, double z, double t, double a) {
double r473232 = x;
double r473233 = y;
double r473234 = r473233 - r473232;
double r473235 = z;
double r473236 = t;
double r473237 = r473235 - r473236;
double r473238 = r473234 * r473237;
double r473239 = a;
double r473240 = r473239 - r473236;
double r473241 = r473238 / r473240;
double r473242 = r473232 + r473241;
return r473242;
}
double f(double x, double y, double z, double t, double a) {
double r473243 = a;
double r473244 = -1.5730863727778726e-148;
bool r473245 = r473243 <= r473244;
double r473246 = y;
double r473247 = x;
double r473248 = r473246 - r473247;
double r473249 = z;
double r473250 = t;
double r473251 = r473249 - r473250;
double r473252 = 1.0;
double r473253 = r473243 - r473250;
double r473254 = r473252 / r473253;
double r473255 = r473251 * r473254;
double r473256 = r473248 * r473255;
double r473257 = r473256 + r473247;
double r473258 = 1.8315839196138794e-164;
bool r473259 = r473243 <= r473258;
double r473260 = r473247 / r473250;
double r473261 = r473249 * r473246;
double r473262 = r473261 / r473250;
double r473263 = r473246 - r473262;
double r473264 = fma(r473260, r473249, r473263);
double r473265 = r473251 / r473253;
double r473266 = r473248 * r473265;
double r473267 = r473266 + r473247;
double r473268 = r473259 ? r473264 : r473267;
double r473269 = r473245 ? r473257 : r473268;
return r473269;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t




Bits error versus a
| Original | 24.5 |
|---|---|
| Target | 9.6 |
| Herbie | 10.6 |
if a < -1.5730863727778726e-148Initial program 23.0
Simplified12.1
rmApplied fma-udef12.2
rmApplied div-inv12.2
Applied associate-*l*10.0
Simplified9.9
rmApplied div-inv10.0
if -1.5730863727778726e-148 < a < 1.8315839196138794e-164Initial program 29.7
Simplified24.1
rmApplied fma-udef24.2
rmApplied div-inv24.3
Applied associate-*l*19.2
Simplified19.1
Taylor expanded around inf 13.8
Simplified13.7
if 1.8315839196138794e-164 < a Initial program 23.1
Simplified11.6
rmApplied fma-udef11.6
rmApplied div-inv11.7
Applied associate-*l*9.6
Simplified9.5
Final simplification10.6
herbie shell --seed 2019303 +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.7744031700831742e-182) (- y (* (/ z t) (- y x))) (+ x (* (/ (- y x) 1) (/ (- z t) (- a t))))))
(+ x (/ (* (- y x) (- z t)) (- a t))))