Average Error: 5.4 → 4.4
Time: 19.1s
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}\;t \le -2.99899537213478186 \cdot 10^{-73}:\\ \;\;\;\;\mathsf{fma}\left(t, \left(\left(x \cdot 18\right) \cdot 1\right) \cdot \left(y \cdot z\right) - a \cdot 4, b \cdot c - \mathsf{fma}\left(x, 4 \cdot i, 27 \cdot \left(j \cdot k\right)\right)\right)\\ \mathbf{elif}\;t \le 1.99330446316993159 \cdot 10^{-123}:\\ \;\;\;\;\mathsf{fma}\left(t, 0 - a \cdot 4, b \cdot c - \mathsf{fma}\left(x, 4 \cdot i, \left(j \cdot 27\right) \cdot k\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(t, \left(\left(x \cdot 18\right) \cdot y\right) \cdot z - a \cdot 4, b \cdot c - \mathsf{fma}\left(x, 4 \cdot i, j \cdot \left(27 \cdot k\right)\right)\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}\;t \le -2.99899537213478186 \cdot 10^{-73}:\\
\;\;\;\;\mathsf{fma}\left(t, \left(\left(x \cdot 18\right) \cdot 1\right) \cdot \left(y \cdot z\right) - a \cdot 4, b \cdot c - \mathsf{fma}\left(x, 4 \cdot i, 27 \cdot \left(j \cdot k\right)\right)\right)\\

\mathbf{elif}\;t \le 1.99330446316993159 \cdot 10^{-123}:\\
\;\;\;\;\mathsf{fma}\left(t, 0 - a \cdot 4, b \cdot c - \mathsf{fma}\left(x, 4 \cdot i, \left(j \cdot 27\right) \cdot k\right)\right)\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t, \left(\left(x \cdot 18\right) \cdot y\right) \cdot z - a \cdot 4, b \cdot c - \mathsf{fma}\left(x, 4 \cdot i, j \cdot \left(27 \cdot k\right)\right)\right)\\

\end{array}
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
	return ((double) (((double) (((double) (((double) (((double) (((double) (((double) (((double) (x * 18.0)) * y)) * z)) * t)) - ((double) (((double) (a * 4.0)) * t)))) + ((double) (b * c)))) - ((double) (((double) (x * 4.0)) * i)))) - ((double) (((double) (j * 27.0)) * k))));
}
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
	double VAR;
	if ((t <= -2.998995372134782e-73)) {
		VAR = ((double) fma(t, ((double) (((double) (((double) (((double) (x * 18.0)) * 1.0)) * ((double) (y * z)))) - ((double) (a * 4.0)))), ((double) (((double) (b * c)) - ((double) fma(x, ((double) (4.0 * i)), ((double) (27.0 * ((double) (j * k))))))))));
	} else {
		double VAR_1;
		if ((t <= 1.9933044631699316e-123)) {
			VAR_1 = ((double) fma(t, ((double) (0.0 - ((double) (a * 4.0)))), ((double) (((double) (b * c)) - ((double) fma(x, ((double) (4.0 * i)), ((double) (((double) (j * 27.0)) * k))))))));
		} else {
			VAR_1 = ((double) fma(t, ((double) (((double) (((double) (((double) (x * 18.0)) * y)) * z)) - ((double) (a * 4.0)))), ((double) (((double) (b * c)) - ((double) fma(x, ((double) (4.0 * i)), ((double) (j * ((double) (27.0 * k))))))))));
		}
		VAR = VAR_1;
	}
	return VAR;
}

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

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Split input into 3 regimes
  2. if t < -2.998995372134782e-73

    1. Initial program 2.4

      \[\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. Simplified2.5

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

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

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

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

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

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

    if -2.998995372134782e-73 < t < 1.9933044631699316e-123

    1. Initial program 9.1

      \[\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. Simplified9.1

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

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

    if 1.9933044631699316e-123 < t

    1. Initial program 2.4

      \[\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. Simplified2.5

      \[\leadsto \color{blue}{\mathsf{fma}\left(t, \left(\left(x \cdot 18\right) \cdot y\right) \cdot z - a \cdot 4, b \cdot c - \mathsf{fma}\left(x, 4 \cdot i, \left(j \cdot 27\right) \cdot k\right)\right)}\]
    3. Using strategy rm
    4. Applied associate-*l*2.5

      \[\leadsto \mathsf{fma}\left(t, \left(\left(x \cdot 18\right) \cdot y\right) \cdot z - a \cdot 4, b \cdot c - \mathsf{fma}\left(x, 4 \cdot i, \color{blue}{j \cdot \left(27 \cdot k\right)}\right)\right)\]
  3. Recombined 3 regimes into one program.
  4. Final simplification4.4

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \le -2.99899537213478186 \cdot 10^{-73}:\\ \;\;\;\;\mathsf{fma}\left(t, \left(\left(x \cdot 18\right) \cdot 1\right) \cdot \left(y \cdot z\right) - a \cdot 4, b \cdot c - \mathsf{fma}\left(x, 4 \cdot i, 27 \cdot \left(j \cdot k\right)\right)\right)\\ \mathbf{elif}\;t \le 1.99330446316993159 \cdot 10^{-123}:\\ \;\;\;\;\mathsf{fma}\left(t, 0 - a \cdot 4, b \cdot c - \mathsf{fma}\left(x, 4 \cdot i, \left(j \cdot 27\right) \cdot k\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(t, \left(\left(x \cdot 18\right) \cdot y\right) \cdot z - a \cdot 4, b \cdot c - \mathsf{fma}\left(x, 4 \cdot i, j \cdot \left(27 \cdot k\right)\right)\right)\\ \end{array}\]

Reproduce

herbie shell --seed 2020113 +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)))