Average Error: 6.0 → 1.5
Time: 9.2s
Precision: binary64
\[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}\;c \cdot \left(a + b \cdot c\right) = -inf.0:\\ \;\;\;\;2 \cdot \left(x \cdot y + \left(z \cdot t - \sqrt[3]{c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)} \cdot \left(\sqrt[3]{c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)} \cdot \sqrt[3]{c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)}\right)\right)\right)\\ \mathbf{elif}\;c \cdot \left(a + b \cdot c\right) \le 1.8360579417966907 \cdot 10^{276}:\\ \;\;\;\;2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(c \cdot \left(a + b \cdot c\right)\right) \cdot i\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(x \cdot y + \left(z \cdot t - c \cdot \left(\sqrt[3]{\left(a + b \cdot c\right) \cdot i} \cdot \left(\sqrt[3]{\left(a + b \cdot c\right) \cdot i} \cdot \sqrt[3]{\left(a + b \cdot c\right) \cdot i}\right)\right)\right)\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}\;c \cdot \left(a + b \cdot c\right) = -inf.0:\\
\;\;\;\;2 \cdot \left(x \cdot y + \left(z \cdot t - \sqrt[3]{c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)} \cdot \left(\sqrt[3]{c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)} \cdot \sqrt[3]{c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)}\right)\right)\right)\\

\mathbf{elif}\;c \cdot \left(a + b \cdot c\right) \le 1.8360579417966907 \cdot 10^{276}:\\
\;\;\;\;2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(c \cdot \left(a + b \cdot c\right)\right) \cdot i\right)\\

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

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

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original6.0
Target1.8
Herbie1.5
\[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 3 regimes
  2. if (* (+ a (* b c)) c) < -inf.0

    1. Initial program 64.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. Simplified13.7

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

      \[\leadsto 2 \cdot \left(x \cdot y + \left(z \cdot t - \color{blue}{\left(\sqrt[3]{c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)} \cdot \sqrt[3]{c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)}\right) \cdot \sqrt[3]{c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)}}\right)\right)\]
    5. Simplified14.3

      \[\leadsto 2 \cdot \left(x \cdot y + \left(z \cdot t - \color{blue}{\left(\sqrt[3]{c \cdot \left(\left(a + c \cdot b\right) \cdot i\right)} \cdot \sqrt[3]{c \cdot \left(\left(a + c \cdot b\right) \cdot i\right)}\right)} \cdot \sqrt[3]{c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)}\right)\right)\]
    6. Simplified14.3

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

    if -inf.0 < (* (+ a (* b c)) c) < 1.8360579417966907e276

    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)\]

    if 1.8360579417966907e276 < (* (+ a (* b c)) c)

    1. Initial program 48.8

      \[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. Simplified8.3

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

      \[\leadsto 2 \cdot \left(x \cdot y + \left(z \cdot t - c \cdot \color{blue}{\left(\left(\sqrt[3]{\left(a + b \cdot c\right) \cdot i} \cdot \sqrt[3]{\left(a + b \cdot c\right) \cdot i}\right) \cdot \sqrt[3]{\left(a + b \cdot c\right) \cdot i}\right)}\right)\right)\]
    5. Simplified8.9

      \[\leadsto 2 \cdot \left(x \cdot y + \left(z \cdot t - c \cdot \left(\color{blue}{\left(\sqrt[3]{\left(a + c \cdot b\right) \cdot i} \cdot \sqrt[3]{\left(a + c \cdot b\right) \cdot i}\right)} \cdot \sqrt[3]{\left(a + b \cdot c\right) \cdot i}\right)\right)\right)\]
    6. Simplified8.9

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \cdot \left(a + b \cdot c\right) = -inf.0:\\ \;\;\;\;2 \cdot \left(x \cdot y + \left(z \cdot t - \sqrt[3]{c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)} \cdot \left(\sqrt[3]{c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)} \cdot \sqrt[3]{c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)}\right)\right)\right)\\ \mathbf{elif}\;c \cdot \left(a + b \cdot c\right) \le 1.8360579417966907 \cdot 10^{276}:\\ \;\;\;\;2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(c \cdot \left(a + b \cdot c\right)\right) \cdot i\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(x \cdot y + \left(z \cdot t - c \cdot \left(\sqrt[3]{\left(a + b \cdot c\right) \cdot i} \cdot \left(\sqrt[3]{\left(a + b \cdot c\right) \cdot i} \cdot \sqrt[3]{\left(a + b \cdot c\right) \cdot i}\right)\right)\right)\right)\\ \end{array}\]

Reproduce

herbie shell --seed 2020179 
(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.0 (- (+ (* x y) (* z t)) (* (+ a (* b c)) (* c i))))

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