Average Error: 5.8 → 3.9
Time: 33.5s
Precision: 64
\[\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 -1.678881092436276430221066447463770847059 \cdot 10^{-108} \lor \neg \left(z \le 1.231185713899018210228913934991313267285 \cdot 10^{-25}\right):\\ \;\;\;\;\mathsf{fma}\left(c, b, \left(z \cdot \left(x \cdot \left(y \cdot 18\right)\right)\right) \cdot t\right) - \mathsf{fma}\left(4, \mathsf{fma}\left(t, a, x \cdot i\right), j \cdot \left(27 \cdot k\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(c, b, 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, x \cdot i\right), \left(j \cdot 27\right) \cdot k\right)\\ \end{array}\]
\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 -1.678881092436276430221066447463770847059 \cdot 10^{-108} \lor \neg \left(z \le 1.231185713899018210228913934991313267285 \cdot 10^{-25}\right):\\
\;\;\;\;\mathsf{fma}\left(c, b, \left(z \cdot \left(x \cdot \left(y \cdot 18\right)\right)\right) \cdot t\right) - \mathsf{fma}\left(4, \mathsf{fma}\left(t, a, x \cdot i\right), j \cdot \left(27 \cdot k\right)\right)\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(c, b, 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, x \cdot i\right), \left(j \cdot 27\right) \cdot k\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 r76762 = x;
        double r76763 = 18.0;
        double r76764 = r76762 * r76763;
        double r76765 = y;
        double r76766 = r76764 * r76765;
        double r76767 = z;
        double r76768 = r76766 * r76767;
        double r76769 = t;
        double r76770 = r76768 * r76769;
        double r76771 = a;
        double r76772 = 4.0;
        double r76773 = r76771 * r76772;
        double r76774 = r76773 * r76769;
        double r76775 = r76770 - r76774;
        double r76776 = b;
        double r76777 = c;
        double r76778 = r76776 * r76777;
        double r76779 = r76775 + r76778;
        double r76780 = r76762 * r76772;
        double r76781 = i;
        double r76782 = r76780 * r76781;
        double r76783 = r76779 - r76782;
        double r76784 = j;
        double r76785 = 27.0;
        double r76786 = r76784 * r76785;
        double r76787 = k;
        double r76788 = r76786 * r76787;
        double r76789 = r76783 - r76788;
        return r76789;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
        double r76790 = z;
        double r76791 = -1.6788810924362764e-108;
        bool r76792 = r76790 <= r76791;
        double r76793 = 1.2311857138990182e-25;
        bool r76794 = r76790 <= r76793;
        double r76795 = !r76794;
        bool r76796 = r76792 || r76795;
        double r76797 = c;
        double r76798 = b;
        double r76799 = x;
        double r76800 = y;
        double r76801 = 18.0;
        double r76802 = r76800 * r76801;
        double r76803 = r76799 * r76802;
        double r76804 = r76790 * r76803;
        double r76805 = t;
        double r76806 = r76804 * r76805;
        double r76807 = fma(r76797, r76798, r76806);
        double r76808 = 4.0;
        double r76809 = a;
        double r76810 = i;
        double r76811 = r76799 * r76810;
        double r76812 = fma(r76805, r76809, r76811);
        double r76813 = j;
        double r76814 = 27.0;
        double r76815 = k;
        double r76816 = r76814 * r76815;
        double r76817 = r76813 * r76816;
        double r76818 = fma(r76808, r76812, r76817);
        double r76819 = r76807 - r76818;
        double r76820 = r76790 * r76800;
        double r76821 = r76799 * r76820;
        double r76822 = r76805 * r76821;
        double r76823 = r76801 * r76822;
        double r76824 = fma(r76797, r76798, r76823);
        double r76825 = r76813 * r76814;
        double r76826 = r76825 * r76815;
        double r76827 = fma(r76808, r76812, r76826);
        double r76828 = r76824 - r76827;
        double r76829 = r76796 ? r76819 : r76828;
        return r76829;
}

Error

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

Derivation

  1. Split input into 2 regimes
  2. if z < -1.6788810924362764e-108 or 1.2311857138990182e-25 < z

    1. Initial program 6.3

      \[\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\]
    2. Simplified6.3

      \[\leadsto \color{blue}{\mathsf{fma}\left(c, b, \left(\left(\left(x \cdot 18\right) \cdot y\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)}\]
    3. Using strategy rm
    4. Applied associate-*l*6.4

      \[\leadsto \mathsf{fma}\left(c, b, \left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t\right) - \mathsf{fma}\left(4, \mathsf{fma}\left(t, a, x \cdot i\right), \color{blue}{j \cdot \left(27 \cdot k\right)}\right)\]
    5. Using strategy rm
    6. Applied add-cube-cbrt6.5

      \[\leadsto \mathsf{fma}\left(c, b, \left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot \color{blue}{\left(\left(\sqrt[3]{z} \cdot \sqrt[3]{z}\right) \cdot \sqrt[3]{z}\right)}\right) \cdot t\right) - \mathsf{fma}\left(4, \mathsf{fma}\left(t, a, x \cdot i\right), j \cdot \left(27 \cdot k\right)\right)\]
    7. Applied associate-*r*6.5

      \[\leadsto \mathsf{fma}\left(c, b, \color{blue}{\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot \left(\sqrt[3]{z} \cdot \sqrt[3]{z}\right)\right) \cdot \sqrt[3]{z}\right)} \cdot t\right) - \mathsf{fma}\left(4, \mathsf{fma}\left(t, a, x \cdot i\right), j \cdot \left(27 \cdot k\right)\right)\]
    8. Simplified6.5

      \[\leadsto \mathsf{fma}\left(c, b, \left(\color{blue}{\left(\left(\sqrt[3]{z} \cdot \sqrt[3]{z}\right) \cdot \left(18 \cdot \left(x \cdot y\right)\right)\right)} \cdot \sqrt[3]{z}\right) \cdot t\right) - \mathsf{fma}\left(4, \mathsf{fma}\left(t, a, x \cdot i\right), j \cdot \left(27 \cdot k\right)\right)\]
    9. Using strategy rm
    10. Applied *-un-lft-identity6.5

      \[\leadsto \mathsf{fma}\left(c, b, \left(\left(\left(\sqrt[3]{z} \cdot \sqrt[3]{z}\right) \cdot \left(18 \cdot \left(x \cdot y\right)\right)\right) \cdot \sqrt[3]{z}\right) \cdot \color{blue}{\left(1 \cdot t\right)}\right) - \mathsf{fma}\left(4, \mathsf{fma}\left(t, a, x \cdot i\right), j \cdot \left(27 \cdot k\right)\right)\]
    11. Applied associate-*r*6.5

      \[\leadsto \mathsf{fma}\left(c, b, \color{blue}{\left(\left(\left(\left(\sqrt[3]{z} \cdot \sqrt[3]{z}\right) \cdot \left(18 \cdot \left(x \cdot y\right)\right)\right) \cdot \sqrt[3]{z}\right) \cdot 1\right) \cdot t}\right) - \mathsf{fma}\left(4, \mathsf{fma}\left(t, a, x \cdot i\right), j \cdot \left(27 \cdot k\right)\right)\]
    12. Simplified6.4

      \[\leadsto \mathsf{fma}\left(c, b, \color{blue}{\left(z \cdot \left(x \cdot \left(y \cdot 18\right)\right)\right)} \cdot t\right) - \mathsf{fma}\left(4, \mathsf{fma}\left(t, a, x \cdot i\right), j \cdot \left(27 \cdot k\right)\right)\]

    if -1.6788810924362764e-108 < z < 1.2311857138990182e-25

    1. Initial program 5.3

      \[\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\]
    2. Simplified5.3

      \[\leadsto \color{blue}{\mathsf{fma}\left(c, b, \left(\left(\left(x \cdot 18\right) \cdot y\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)}\]
    3. Taylor expanded around inf 0.8

      \[\leadsto \mathsf{fma}\left(c, b, \color{blue}{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, x \cdot i\right), \left(j \cdot 27\right) \cdot k\right)\]
  3. Recombined 2 regimes into one program.
  4. Final simplification3.9

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \le -1.678881092436276430221066447463770847059 \cdot 10^{-108} \lor \neg \left(z \le 1.231185713899018210228913934991313267285 \cdot 10^{-25}\right):\\ \;\;\;\;\mathsf{fma}\left(c, b, \left(z \cdot \left(x \cdot \left(y \cdot 18\right)\right)\right) \cdot t\right) - \mathsf{fma}\left(4, \mathsf{fma}\left(t, a, x \cdot i\right), j \cdot \left(27 \cdot k\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(c, b, 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, x \cdot i\right), \left(j \cdot 27\right) \cdot k\right)\\ \end{array}\]

Reproduce

herbie shell --seed 2019235 +o rules:numerics
(FPCore (x y z t a b c i j k)
  :name "Diagrams.Solve.Polynomial:cubForm  from diagrams-solve-0.1"
  :precision binary64
  (- (- (+ (- (* (* (* (* x 18) y) z) t) (* (* a 4) t)) (* b c)) (* (* x 4) i)) (* (* j 27) k)))