Average Error: 6.6 → 1.2
Time: 9.0s
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 \leq -8.239592311601601 \cdot 10^{+58} \lor \neg \left(c \leq 1063779.5953460033\right):\\ \;\;\;\;2 \cdot \left(x \cdot y + \left(z \cdot t - c \cdot \left(c \cdot \left(b \cdot i\right) + i \cdot a\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(\left(x \cdot y + z \cdot t\right) - i \cdot \left(c \cdot \left(a + c \cdot b\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 \leq -8.239592311601601 \cdot 10^{+58} \lor \neg \left(c \leq 1063779.5953460033\right):\\
\;\;\;\;2 \cdot \left(x \cdot y + \left(z \cdot t - c \cdot \left(c \cdot \left(b \cdot i\right) + i \cdot a\right)\right)\right)\\

\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\left(x \cdot y + z \cdot t\right) - i \cdot \left(c \cdot \left(a + c \cdot b\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 (((c <= -8.239592311601601e+58) || !(c <= 1063779.5953460033))) {
		VAR = ((double) (2.0 * ((double) (((double) (x * y)) + ((double) (((double) (z * t)) - ((double) (c * ((double) (((double) (c * ((double) (b * i)))) + ((double) (i * a))))))))))));
	} else {
		VAR = ((double) (2.0 * ((double) (((double) (((double) (x * y)) + ((double) (z * t)))) - ((double) (i * ((double) (c * ((double) (a + ((double) (c * b))))))))))));
	}
	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.6
Target1.7
Herbie1.2
\[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 c < -8.2395923116016015e58 or 1063779.5953460033 < c

    1. Initial program Error: 23.4 bits

      \[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. SimplifiedError: 3.5 bits

      \[\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-cbrtError: 4.1 bits

      \[\leadsto 2 \cdot \left(x \cdot y + \left(z \cdot t - c \cdot \left(\color{blue}{\left(\left(\sqrt[3]{a + b \cdot c} \cdot \sqrt[3]{a + b \cdot c}\right) \cdot \sqrt[3]{a + b \cdot c}\right)} \cdot i\right)\right)\right)\]
    5. Applied associate-*l*Error: 4.1 bits

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

      \[\leadsto 2 \cdot \left(x \cdot y + \left(z \cdot t - c \cdot \left(\left(\sqrt[3]{a + b \cdot c} \cdot \sqrt[3]{a + b \cdot c}\right) \cdot \color{blue}{\left(i \cdot \sqrt[3]{a + c \cdot b}\right)}\right)\right)\right)\]
    7. Using strategy rm
    8. Applied associate-*r*Error: 14.6 bits

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

      \[\leadsto 2 \cdot \left(x \cdot y + \left(z \cdot t - \color{blue}{\left(c \cdot {\left(\sqrt[3]{a + c \cdot b}\right)}^{2}\right)} \cdot \left(i \cdot \sqrt[3]{a + c \cdot b}\right)\right)\right)\]
    10. Taylor expanded around inf Error: 29.9 bits

      \[\leadsto 2 \cdot \left(x \cdot y + \left(z \cdot t - \color{blue}{\left(i \cdot \left(b \cdot {c}^{2}\right) + a \cdot \left(i \cdot c\right)\right)}\right)\right)\]
    11. SimplifiedError: 2.7 bits

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

    if -8.2395923116016015e58 < c < 1063779.5953460033

    1. Initial program Error: 0.7 bits

      \[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 simplificationError: 1.2 bits

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -8.239592311601601 \cdot 10^{+58} \lor \neg \left(c \leq 1063779.5953460033\right):\\ \;\;\;\;2 \cdot \left(x \cdot y + \left(z \cdot t - c \cdot \left(c \cdot \left(b \cdot i\right) + i \cdot a\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(\left(x \cdot y + z \cdot t\right) - i \cdot \left(c \cdot \left(a + c \cdot b\right)\right)\right)\\ \end{array}\]

Reproduce

herbie shell --seed 2020200 
(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))))