Average Error: 6.7 → 1.4
Time: 8.9s
Precision: 64
\[2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right)\]
\[\begin{array}{l} \mathbf{if}\;\left(a + b \cdot c\right) \cdot c = -\infty \lor \neg \left(\left(a + b \cdot c\right) \cdot c \le 9.86371185643557259 \cdot 10^{294}\right):\\ \;\;\;\;\mathsf{fma}\left(2, \left(\sqrt[3]{\mathsf{fma}\left(x, y, z \cdot t\right)} \cdot \sqrt[3]{\mathsf{fma}\left(x, y, z \cdot t\right)}\right) \cdot \sqrt[3]{\mathsf{fma}\left(x, y, z \cdot t\right)}, 2 \cdot \left(\left(-\mathsf{fma}\left(c, b, a\right)\right) \cdot \left(c \cdot i\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right)\\ \end{array}\]
2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right)
\begin{array}{l}
\mathbf{if}\;\left(a + b \cdot c\right) \cdot c = -\infty \lor \neg \left(\left(a + b \cdot c\right) \cdot c \le 9.86371185643557259 \cdot 10^{294}\right):\\
\;\;\;\;\mathsf{fma}\left(2, \left(\sqrt[3]{\mathsf{fma}\left(x, y, z \cdot t\right)} \cdot \sqrt[3]{\mathsf{fma}\left(x, y, z \cdot t\right)}\right) \cdot \sqrt[3]{\mathsf{fma}\left(x, y, z \cdot t\right)}, 2 \cdot \left(\left(-\mathsf{fma}\left(c, b, a\right)\right) \cdot \left(c \cdot i\right)\right)\right)\\

\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right)\\

\end{array}
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	return (2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i)));
}
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double VAR;
	if (((((a + (b * c)) * c) <= -inf.0) || !(((a + (b * c)) * c) <= 9.863711856435573e+294))) {
		VAR = fma(2.0, ((cbrt(fma(x, y, (z * t))) * cbrt(fma(x, y, (z * t)))) * cbrt(fma(x, y, (z * t)))), (2.0 * (-fma(c, b, a) * (c * i))));
	} else {
		VAR = (2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i)));
	}
	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

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original6.7
Target1.9
Herbie1.4
\[2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(a + b \cdot c\right) \cdot \left(c \cdot i\right)\right)\]

Derivation

  1. Split input into 2 regimes
  2. if (* (+ a (* b c)) c) < -inf.0 or 9.863711856435573e+294 < (* (+ a (* b c)) c)

    1. Initial program 61.0

      \[2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right)\]
    2. Simplified9.7

      \[\leadsto \color{blue}{\mathsf{fma}\left(2, \mathsf{fma}\left(x, y, z \cdot t\right), 2 \cdot \left(\left(-\mathsf{fma}\left(c, b, a\right)\right) \cdot \left(c \cdot i\right)\right)\right)}\]
    3. Using strategy rm
    4. Applied add-cube-cbrt9.9

      \[\leadsto \mathsf{fma}\left(2, \color{blue}{\left(\sqrt[3]{\mathsf{fma}\left(x, y, z \cdot t\right)} \cdot \sqrt[3]{\mathsf{fma}\left(x, y, z \cdot t\right)}\right) \cdot \sqrt[3]{\mathsf{fma}\left(x, y, z \cdot t\right)}}, 2 \cdot \left(\left(-\mathsf{fma}\left(c, b, a\right)\right) \cdot \left(c \cdot i\right)\right)\right)\]

    if -inf.0 < (* (+ a (* b c)) c) < 9.863711856435573e+294

    1. Initial program 0.4

      \[2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right)\]
  3. Recombined 2 regimes into one program.
  4. Final simplification1.4

    \[\leadsto \begin{array}{l} \mathbf{if}\;\left(a + b \cdot c\right) \cdot c = -\infty \lor \neg \left(\left(a + b \cdot c\right) \cdot c \le 9.86371185643557259 \cdot 10^{294}\right):\\ \;\;\;\;\mathsf{fma}\left(2, \left(\sqrt[3]{\mathsf{fma}\left(x, y, z \cdot t\right)} \cdot \sqrt[3]{\mathsf{fma}\left(x, y, z \cdot t\right)}\right) \cdot \sqrt[3]{\mathsf{fma}\left(x, y, z \cdot t\right)}, 2 \cdot \left(\left(-\mathsf{fma}\left(c, b, a\right)\right) \cdot \left(c \cdot i\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right)\\ \end{array}\]

Reproduce

herbie shell --seed 2020102 +o rules:numerics
(FPCore (x y z t a b c i)
  :name "Diagrams.ThreeD.Shapes:frustum from diagrams-lib-1.3.0.3, A"
  :precision binary64

  :herbie-target
  (* 2 (- (+ (* x y) (* z t)) (* (+ a (* b c)) (* c i))))

  (* 2 (- (+ (* x y) (* z t)) (* (* (+ a (* b c)) c) i))))