\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k
\begin{array}{l}
\mathbf{if}\;t \le -4.802521353136590134090568041763149695323 \cdot 10^{-178}:\\
\;\;\;\;\mathsf{fma}\left(c, b, \left(\left(\left(y \cdot x\right) \cdot 18\right) \cdot z\right) \cdot t\right) - \mathsf{fma}\left(4, \mathsf{fma}\left(t, a, x \cdot i\right), \left(j \cdot 27\right) \cdot k\right)\\
\mathbf{elif}\;t \le 4.339340101075432744492970777980355608709 \cdot 10^{-63}:\\
\;\;\;\;\mathsf{fma}\left(c, b, \left(\left(x \cdot 18\right) \cdot y\right) \cdot \left(t \cdot z\right)\right) - \mathsf{fma}\left(4, \mathsf{fma}\left(t, a, x \cdot i\right), \left(27 \cdot k\right) \cdot j\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(c, b, \left(\left(x \cdot 18\right) \cdot \left(y \cdot z\right)\right) \cdot t\right) - \mathsf{fma}\left(4, \mathsf{fma}\left(t, a, x \cdot i\right), \left(27 \cdot k\right) \cdot j\right)\\
\end{array}double f(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double r571787 = x;
double r571788 = 18.0;
double r571789 = r571787 * r571788;
double r571790 = y;
double r571791 = r571789 * r571790;
double r571792 = z;
double r571793 = r571791 * r571792;
double r571794 = t;
double r571795 = r571793 * r571794;
double r571796 = a;
double r571797 = 4.0;
double r571798 = r571796 * r571797;
double r571799 = r571798 * r571794;
double r571800 = r571795 - r571799;
double r571801 = b;
double r571802 = c;
double r571803 = r571801 * r571802;
double r571804 = r571800 + r571803;
double r571805 = r571787 * r571797;
double r571806 = i;
double r571807 = r571805 * r571806;
double r571808 = r571804 - r571807;
double r571809 = j;
double r571810 = 27.0;
double r571811 = r571809 * r571810;
double r571812 = k;
double r571813 = r571811 * r571812;
double r571814 = r571808 - r571813;
return r571814;
}
double f(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double r571815 = t;
double r571816 = -4.80252135313659e-178;
bool r571817 = r571815 <= r571816;
double r571818 = c;
double r571819 = b;
double r571820 = y;
double r571821 = x;
double r571822 = r571820 * r571821;
double r571823 = 18.0;
double r571824 = r571822 * r571823;
double r571825 = z;
double r571826 = r571824 * r571825;
double r571827 = r571826 * r571815;
double r571828 = fma(r571818, r571819, r571827);
double r571829 = 4.0;
double r571830 = a;
double r571831 = i;
double r571832 = r571821 * r571831;
double r571833 = fma(r571815, r571830, r571832);
double r571834 = j;
double r571835 = 27.0;
double r571836 = r571834 * r571835;
double r571837 = k;
double r571838 = r571836 * r571837;
double r571839 = fma(r571829, r571833, r571838);
double r571840 = r571828 - r571839;
double r571841 = 4.339340101075433e-63;
bool r571842 = r571815 <= r571841;
double r571843 = r571821 * r571823;
double r571844 = r571843 * r571820;
double r571845 = r571815 * r571825;
double r571846 = r571844 * r571845;
double r571847 = fma(r571818, r571819, r571846);
double r571848 = r571835 * r571837;
double r571849 = r571848 * r571834;
double r571850 = fma(r571829, r571833, r571849);
double r571851 = r571847 - r571850;
double r571852 = r571820 * r571825;
double r571853 = r571843 * r571852;
double r571854 = r571853 * r571815;
double r571855 = fma(r571818, r571819, r571854);
double r571856 = r571855 - r571850;
double r571857 = r571842 ? r571851 : r571856;
double r571858 = r571817 ? r571840 : r571857;
return r571858;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t




Bits error versus a




Bits error versus b




Bits error versus c




Bits error versus i




Bits error versus j




Bits error versus k
| Original | 5.5 |
|---|---|
| Target | 1.6 |
| Herbie | 3.9 |
if t < -4.80252135313659e-178Initial program 4.0
Simplified3.9
rmApplied associate-*l*4.0
Simplified4.0
rmApplied associate-*r*3.9
Simplified3.9
if -4.80252135313659e-178 < t < 4.339340101075433e-63Initial program 8.5
Simplified8.5
rmApplied pow18.5
Applied pow18.5
Applied pow18.5
Applied pow-prod-down8.5
Applied pow-prod-down8.5
Simplified8.4
rmApplied associate-*l*4.4
Simplified4.4
if 4.339340101075433e-63 < t Initial program 3.0
Simplified2.9
rmApplied pow12.9
Applied pow12.9
Applied pow12.9
Applied pow-prod-down2.9
Applied pow-prod-down2.9
Simplified3.0
rmApplied associate-*l*3.3
Final simplification3.9
herbie shell --seed 2019208 +o rules:numerics
(FPCore (x y z t a b c i j k)
:name "Diagrams.Solve.Polynomial:cubForm from diagrams-solve-0.1, E"
:precision binary64
:herbie-target
(if (< t -1.6210815397541398e-69) (- (- (* (* 18 t) (* (* x y) z)) (* (+ (* a t) (* i x)) 4)) (- (* (* k j) 27) (* c b))) (if (< t 165.680279438052224) (+ (- (* (* 18 y) (* x (* z t))) (* (+ (* a t) (* i x)) 4)) (- (* c b) (* 27 (* k j)))) (- (- (* (* 18 t) (* (* x y) z)) (* (+ (* a t) (* i x)) 4)) (- (* (* k j) 27) (* c b)))))
(- (- (+ (- (* (* (* (* x 18) y) z) t) (* (* a 4) t)) (* b c)) (* (* x 4) i)) (* (* j 27) k)))