x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z}\begin{array}{l}
\mathbf{if}\;a \le -9.8404651186129391 \cdot 10^{-176}:\\
\;\;\;\;\mathsf{fma}\left(\left(y - z\right) \cdot \frac{1}{a - z}, t - x, x\right)\\
\mathbf{elif}\;a \le 2.40307220610057875 \cdot 10^{-111}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{x}{z} - \frac{t}{z}, t\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{t - x}{\frac{a - z}{y - z}} + x\\
\end{array}double code(double x, double y, double z, double t, double a) {
return (x + (((y - z) * (t - x)) / (a - z)));
}
double code(double x, double y, double z, double t, double a) {
double VAR;
if ((a <= -9.840465118612939e-176)) {
VAR = fma(((y - z) * (1.0 / (a - z))), (t - x), x);
} else {
double VAR_1;
if ((a <= 2.4030722061005788e-111)) {
VAR_1 = fma(y, ((x / z) - (t / z)), t);
} else {
VAR_1 = (((t - x) / ((a - z) / (y - z))) + x);
}
VAR = VAR_1;
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t




Bits error versus a
Results
| Original | 24.2 |
|---|---|
| Target | 12.0 |
| Herbie | 10.0 |
if a < -9.840465118612939e-176Initial program 23.1
Simplified9.8
rmApplied div-inv9.8
if -9.840465118612939e-176 < a < 2.4030722061005788e-111Initial program 28.3
Simplified19.2
Taylor expanded around inf 14.2
Simplified12.4
if 2.4030722061005788e-111 < a Initial program 22.8
Simplified8.5
rmApplied clear-num8.5
rmApplied fma-udef8.5
Simplified8.5
Final simplification10.0
herbie shell --seed 2020091 +o rules:numerics
(FPCore (x y z t a)
:name "Graphics.Rendering.Chart.Axis.Types:invLinMap from Chart-1.5.3"
:precision binary64
:herbie-target
(if (< z -1.2536131056095036e+188) (- t (* (/ y z) (- t x))) (if (< z 4.446702369113811e+64) (+ x (/ (- y z) (/ (- a z) (- t x)))) (- t (* (/ y z) (- t x)))))
(+ x (/ (* (- y z) (- t x)) (- a z))))