Average Error: 6.4 → 1.4
Time: 9.1s
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) \le -6.6718665363388854 \cdot 10^{206} \lor \neg \left(c \cdot \left(a + b \cdot c\right) \le 1.3095322706262552 \cdot 10^{237}\right):\\ \;\;\;\;2 \cdot \left(x \cdot y + \left(z \cdot t - c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(c \cdot \left(a + b \cdot c\right)\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}\;c \cdot \left(a + b \cdot c\right) \le -6.6718665363388854 \cdot 10^{206} \lor \neg \left(c \cdot \left(a + b \cdot c\right) \le 1.3095322706262552 \cdot 10^{237}\right):\\
\;\;\;\;2 \cdot \left(x \cdot y + \left(z \cdot t - c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\right)\\

\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(c \cdot \left(a + b \cdot c\right)\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 ((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)))))) <= -6.671866536338885e+206) || !(((double) (c * ((double) (a + ((double) (b * c)))))) <= 1.3095322706262552e+237))) {
		VAR = ((double) (2.0 * ((double) (((double) (x * y)) + ((double) (((double) (z * t)) - ((double) (c * ((double) (((double) (a + ((double) (b * c)))) * i))))))))));
	} else {
		VAR = ((double) (2.0 * ((double) (((double) (((double) (x * y)) + ((double) (z * t)))) - ((double) (((double) (c * ((double) (a + ((double) (b * 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.4
Target2.0
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) < -6.6718665363388854e206 or 1.3095322706262552e237 < (* (+ a (* b c)) c)

    1. Initial program 36.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. Simplified6.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)}\]

    if -6.6718665363388854e206 < (* (+ a (* b c)) c) < 1.3095322706262552e237

    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}\;c \cdot \left(a + b \cdot c\right) \le -6.6718665363388854 \cdot 10^{206} \lor \neg \left(c \cdot \left(a + b \cdot c\right) \le 1.3095322706262552 \cdot 10^{237}\right):\\ \;\;\;\;2 \cdot \left(x \cdot y + \left(z \cdot t - c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(c \cdot \left(a + b \cdot c\right)\right) \cdot i\right)\\ \end{array}\]

Reproduce

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