\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 -2.984753943024447 \cdot 10^{-166}:\\
\;\;\;\;\mathsf{fma}\left(t, {\left(18 \cdot \left(\left(x \cdot z\right) \cdot y\right)\right)}^{1} - a \cdot 4, b \cdot c - \mathsf{fma}\left(x, 4 \cdot i, \left(j \cdot 27\right) \cdot k\right)\right)\\
\mathbf{elif}\;t \le 4.6506436021600571 \cdot 10^{-67}:\\
\;\;\;\;\mathsf{fma}\left(t, {0}^{1} - a \cdot 4, b \cdot c - \mathsf{fma}\left(x, 4 \cdot i, \left(j \cdot 27\right) \cdot k\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left({\left(18 \cdot \left(x \cdot \left(z \cdot y\right)\right)\right)}^{1} - a \cdot 4\right) + \left(b \cdot c - \mathsf{fma}\left(x, 4 \cdot i, \left(j \cdot 27\right) \cdot k\right)\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 r679781 = x;
double r679782 = 18.0;
double r679783 = r679781 * r679782;
double r679784 = y;
double r679785 = r679783 * r679784;
double r679786 = z;
double r679787 = r679785 * r679786;
double r679788 = t;
double r679789 = r679787 * r679788;
double r679790 = a;
double r679791 = 4.0;
double r679792 = r679790 * r679791;
double r679793 = r679792 * r679788;
double r679794 = r679789 - r679793;
double r679795 = b;
double r679796 = c;
double r679797 = r679795 * r679796;
double r679798 = r679794 + r679797;
double r679799 = r679781 * r679791;
double r679800 = i;
double r679801 = r679799 * r679800;
double r679802 = r679798 - r679801;
double r679803 = j;
double r679804 = 27.0;
double r679805 = r679803 * r679804;
double r679806 = k;
double r679807 = r679805 * r679806;
double r679808 = r679802 - r679807;
return r679808;
}
double f(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double r679809 = t;
double r679810 = -2.984753943024447e-166;
bool r679811 = r679809 <= r679810;
double r679812 = 18.0;
double r679813 = x;
double r679814 = z;
double r679815 = r679813 * r679814;
double r679816 = y;
double r679817 = r679815 * r679816;
double r679818 = r679812 * r679817;
double r679819 = 1.0;
double r679820 = pow(r679818, r679819);
double r679821 = a;
double r679822 = 4.0;
double r679823 = r679821 * r679822;
double r679824 = r679820 - r679823;
double r679825 = b;
double r679826 = c;
double r679827 = r679825 * r679826;
double r679828 = i;
double r679829 = r679822 * r679828;
double r679830 = j;
double r679831 = 27.0;
double r679832 = r679830 * r679831;
double r679833 = k;
double r679834 = r679832 * r679833;
double r679835 = fma(r679813, r679829, r679834);
double r679836 = r679827 - r679835;
double r679837 = fma(r679809, r679824, r679836);
double r679838 = 4.650643602160057e-67;
bool r679839 = r679809 <= r679838;
double r679840 = 0.0;
double r679841 = pow(r679840, r679819);
double r679842 = r679841 - r679823;
double r679843 = fma(r679809, r679842, r679836);
double r679844 = r679814 * r679816;
double r679845 = r679813 * r679844;
double r679846 = r679812 * r679845;
double r679847 = pow(r679846, r679819);
double r679848 = r679847 - r679823;
double r679849 = r679809 * r679848;
double r679850 = r679849 + r679836;
double r679851 = r679839 ? r679843 : r679850;
double r679852 = r679811 ? r679837 : r679851;
return r679852;
}




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.6 |
|---|---|
| Target | 1.5 |
| Herbie | 4.4 |
if t < -2.984753943024447e-166Initial program 4.0
Simplified4.1
rmApplied pow14.1
Applied pow14.1
Applied pow14.1
Applied pow14.1
Applied pow-prod-down4.1
Applied pow-prod-down4.1
Applied pow-prod-down4.1
Simplified4.6
rmApplied associate-*r*3.5
if -2.984753943024447e-166 < t < 4.650643602160057e-67Initial program 8.8
Simplified8.8
rmApplied pow18.8
Applied pow18.8
Applied pow18.8
Applied pow18.8
Applied pow-prod-down8.8
Applied pow-prod-down8.8
Applied pow-prod-down8.8
Simplified9.7
Taylor expanded around 0 6.5
if 4.650643602160057e-67 < t Initial program 2.5
Simplified2.5
rmApplied pow12.5
Applied pow12.5
Applied pow12.5
Applied pow12.5
Applied pow-prod-down2.5
Applied pow-prod-down2.5
Applied pow-prod-down2.5
Simplified2.4
rmApplied fma-udef2.4
Final simplification4.4
herbie shell --seed 2020033 +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.68027943805222) (+ (- (* (* 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)))