Average Error: 6.1 → 1.1
Time: 8.8s
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.732376824552743 \cdot 10^{+32} \lor \neg \left(c \leq 1.7431770553341943 \cdot 10^{-06}\right):\\ \;\;\;\;2 \cdot \left(x \cdot y + \left(z \cdot t - c \cdot \left(\left(a + c \cdot b\right) \cdot i\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.732376824552743 \cdot 10^{+32} \lor \neg \left(c \leq 1.7431770553341943 \cdot 10^{-06}\right):\\
\;\;\;\;2 \cdot \left(x \cdot y + \left(z \cdot t - c \cdot \left(\left(a + c \cdot b\right) \cdot i\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.732376824552743e+32) || !(c <= 1.7431770553341943e-06))) {
		VAR = ((double) (2.0 * ((double) (((double) (x * y)) + ((double) (((double) (z * t)) - ((double) (c * ((double) (((double) (a + ((double) (c * b)))) * i))))))))));
	} 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.1
Target1.8
Herbie1.1
\[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.73237682455274312e32 or 1.7431770553341943e-6 < c

    1. Initial program 20.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. Simplified2.8

      \[\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 -8.73237682455274312e32 < c < 1.7431770553341943e-6

    1. Initial program 0.5

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -8.732376824552743 \cdot 10^{+32} \lor \neg \left(c \leq 1.7431770553341943 \cdot 10^{-06}\right):\\ \;\;\;\;2 \cdot \left(x \cdot y + \left(z \cdot t - c \cdot \left(\left(a + c \cdot b\right) \cdot i\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 2020199 
(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))))