\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}\;z \le -8.438842758934493 \cdot 10^{49} \lor \neg \left(z \le 1.554625306792136 \cdot 10^{-183}\right):\\
\;\;\;\;\mathsf{fma}\left(t, \left(\left(x \cdot 18\right) \cdot y\right) \cdot z, b \cdot c\right) - \mathsf{fma}\left(4, \mathsf{fma}\left(t, a, i \cdot x\right), 27 \cdot \left(k \cdot j\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(b, c, 18 \cdot \left(t \cdot \left(x \cdot \left(z \cdot y\right)\right)\right)\right) - \mathsf{fma}\left(4, \mathsf{fma}\left(t, a, i \cdot x\right), 27 \cdot \left(k \cdot j\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 r834569 = x;
double r834570 = 18.0;
double r834571 = r834569 * r834570;
double r834572 = y;
double r834573 = r834571 * r834572;
double r834574 = z;
double r834575 = r834573 * r834574;
double r834576 = t;
double r834577 = r834575 * r834576;
double r834578 = a;
double r834579 = 4.0;
double r834580 = r834578 * r834579;
double r834581 = r834580 * r834576;
double r834582 = r834577 - r834581;
double r834583 = b;
double r834584 = c;
double r834585 = r834583 * r834584;
double r834586 = r834582 + r834585;
double r834587 = r834569 * r834579;
double r834588 = i;
double r834589 = r834587 * r834588;
double r834590 = r834586 - r834589;
double r834591 = j;
double r834592 = 27.0;
double r834593 = r834591 * r834592;
double r834594 = k;
double r834595 = r834593 * r834594;
double r834596 = r834590 - r834595;
return r834596;
}
double f(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double r834597 = z;
double r834598 = -8.438842758934493e+49;
bool r834599 = r834597 <= r834598;
double r834600 = 1.554625306792136e-183;
bool r834601 = r834597 <= r834600;
double r834602 = !r834601;
bool r834603 = r834599 || r834602;
double r834604 = t;
double r834605 = x;
double r834606 = 18.0;
double r834607 = r834605 * r834606;
double r834608 = y;
double r834609 = r834607 * r834608;
double r834610 = r834609 * r834597;
double r834611 = b;
double r834612 = c;
double r834613 = r834611 * r834612;
double r834614 = fma(r834604, r834610, r834613);
double r834615 = 4.0;
double r834616 = a;
double r834617 = i;
double r834618 = r834617 * r834605;
double r834619 = fma(r834604, r834616, r834618);
double r834620 = 27.0;
double r834621 = k;
double r834622 = j;
double r834623 = r834621 * r834622;
double r834624 = r834620 * r834623;
double r834625 = fma(r834615, r834619, r834624);
double r834626 = r834614 - r834625;
double r834627 = r834597 * r834608;
double r834628 = r834605 * r834627;
double r834629 = r834604 * r834628;
double r834630 = r834606 * r834629;
double r834631 = fma(r834611, r834612, r834630);
double r834632 = r834631 - r834625;
double r834633 = r834603 ? r834626 : r834632;
return r834633;
}




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.6 |
| Herbie | 4.0 |
if z < -8.438842758934493e+49 or 1.554625306792136e-183 < z Initial program 6.2
Simplified6.2
rmApplied pow16.2
Applied pow16.2
Applied pow16.2
Applied pow-prod-down6.2
Applied pow-prod-down6.2
Simplified6.1
if -8.438842758934493e+49 < z < 1.554625306792136e-183Initial program 4.7
Simplified4.7
rmApplied pow14.7
Applied pow14.7
Applied pow14.7
Applied pow-prod-down4.7
Applied pow-prod-down4.7
Simplified4.6
Taylor expanded around inf 1.3
Simplified1.3
Final simplification4.0
herbie shell --seed 2020042 +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)))