x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t}\begin{array}{l}
\mathbf{if}\;x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t} \le -1.40201348302002751 \cdot 10^{-300} \lor \neg \left(x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t} \le 0.0\right):\\
\;\;\;\;\mathsf{fma}\left(y - x, \left(z - t\right) \cdot \frac{1}{a - t}, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{x}{t}, z, y - \frac{z \cdot y}{t}\right)\\
\end{array}double code(double x, double y, double z, double t, double a) {
return ((double) (x + ((double) (((double) (((double) (y - x)) * ((double) (z - t)))) / ((double) (a - t))))));
}
double code(double x, double y, double z, double t, double a) {
double VAR;
if (((((double) (x + ((double) (((double) (((double) (y - x)) * ((double) (z - t)))) / ((double) (a - t)))))) <= -1.4020134830200275e-300) || !(((double) (x + ((double) (((double) (((double) (y - x)) * ((double) (z - t)))) / ((double) (a - t)))))) <= 0.0))) {
VAR = ((double) fma(((double) (y - x)), ((double) (((double) (z - t)) * ((double) (1.0 / ((double) (a - t)))))), x));
} else {
VAR = ((double) fma(((double) (x / t)), z, ((double) (y - ((double) (((double) (z * y)) / t))))));
}
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.7 |
|---|---|
| Target | 9.3 |
| Herbie | 8.8 |
if (+ x (/ (* (- y x) (- z t)) (- a t))) < -1.4020134830200275e-300 or 0.0 < (+ x (/ (* (- y x) (- z t)) (- a t))) Initial program 21.6
Simplified11.1
rmApplied fma-udef11.1
rmApplied div-inv11.2
Applied associate-*l*7.7
Simplified7.6
rmApplied fma-def7.6
rmApplied div-inv7.7
if -1.4020134830200275e-300 < (+ x (/ (* (- y x) (- z t)) (- a t))) < 0.0Initial program 60.7
Simplified60.8
rmApplied fma-udef61.1
rmApplied div-inv61.0
Applied associate-*l*60.7
Simplified60.7
Taylor expanded around inf 19.6
Simplified21.8
Final simplification8.8
herbie shell --seed 2020123 +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))))