x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t}\begin{array}{l}
\mathbf{if}\;a \le -2.20331773349185484 \cdot 10^{-103}:\\
\;\;\;\;\mathsf{fma}\left(\left(y - x\right) \cdot 1, \frac{z - t}{a - t}, x\right)\\
\mathbf{elif}\;a \le 9.9754990961997594 \cdot 10^{-141}:\\
\;\;\;\;\mathsf{fma}\left(\frac{x}{t}, z, y - \frac{z \cdot y}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{\sqrt[3]{y - x} \cdot \sqrt[3]{y - x}}{\sqrt[3]{a - t} \cdot \sqrt[3]{a - t}}, \frac{\sqrt[3]{y - x}}{\sqrt[3]{a - t}} \cdot \left(z - t\right), x\right)\\
\end{array}double code(double x, double y, double z, double t, double a) {
return (x + (((y - x) * (z - t)) / (a - t)));
}
double code(double x, double y, double z, double t, double a) {
double temp;
if ((a <= -2.2033177334918548e-103)) {
temp = fma(((y - x) * 1.0), ((z - t) / (a - t)), x);
} else {
double temp_1;
if ((a <= 9.975499096199759e-141)) {
temp_1 = fma((x / t), z, (y - ((z * y) / t)));
} else {
temp_1 = fma(((cbrt((y - x)) * cbrt((y - x))) / (cbrt((a - t)) * cbrt((a - t)))), ((cbrt((y - x)) / cbrt((a - t))) * (z - t)), x);
}
temp = temp_1;
}
return temp;
}




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 | 9.3 |
| Herbie | 10.4 |
if a < -2.2033177334918548e-103Initial program 22.0
Simplified10.4
rmApplied fma-udef10.5
rmApplied div-inv10.6
Applied associate-*l*8.5
Simplified8.4
rmApplied *-un-lft-identity8.4
Applied associate-*r*8.4
Applied fma-def8.4
if -2.2033177334918548e-103 < a < 9.975499096199759e-141Initial program 30.3
Simplified25.1
rmApplied fma-udef25.0
rmApplied div-inv25.1
Applied associate-*l*20.5
Simplified20.4
Taylor expanded around inf 15.0
Simplified14.4
if 9.975499096199759e-141 < a Initial program 21.8
Simplified11.4
rmApplied fma-udef11.4
rmApplied add-cube-cbrt11.9
Applied add-cube-cbrt12.1
Applied times-frac12.1
Applied associate-*l*9.5
Applied fma-def9.5
Final simplification10.4
herbie shell --seed 2020066 +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))))