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 r1063120 = x;
double r1063121 = y;
double r1063122 = r1063121 - r1063120;
double r1063123 = z;
double r1063124 = t;
double r1063125 = r1063123 - r1063124;
double r1063126 = r1063122 * r1063125;
double r1063127 = a;
double r1063128 = r1063127 - r1063124;
double r1063129 = r1063126 / r1063128;
double r1063130 = r1063120 + r1063129;
return r1063130;
}
double f(double x, double y, double z, double t, double a) {
double r1063131 = a;
double r1063132 = -1.5730863727778726e-148;
bool r1063133 = r1063131 <= r1063132;
double r1063134 = y;
double r1063135 = x;
double r1063136 = r1063134 - r1063135;
double r1063137 = z;
double r1063138 = t;
double r1063139 = r1063137 - r1063138;
double r1063140 = 1.0;
double r1063141 = r1063131 - r1063138;
double r1063142 = r1063140 / r1063141;
double r1063143 = r1063139 * r1063142;
double r1063144 = r1063136 * r1063143;
double r1063145 = r1063144 + r1063135;
double r1063146 = 1.8315839196138794e-164;
bool r1063147 = r1063131 <= r1063146;
double r1063148 = r1063135 / r1063138;
double r1063149 = r1063137 * r1063134;
double r1063150 = r1063149 / r1063138;
double r1063151 = r1063134 - r1063150;
double r1063152 = fma(r1063148, r1063137, r1063151);
double r1063153 = r1063139 / r1063141;
double r1063154 = r1063136 * r1063153;
double r1063155 = r1063154 + r1063135;
double r1063156 = r1063147 ? r1063152 : r1063155;
double r1063157 = r1063133 ? r1063145 : r1063156;
return r1063157;
}




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))))