Average Error: 6.2 → 1.5
Time: 9.9s
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}\;i \leq -2.6177420105736684 \cdot 10^{+24} \lor \neg \left(i \leq 3.558842578980158 \cdot 10^{+69}\right):\\ \;\;\;\;2 \cdot \left(\left(x \cdot y + z \cdot t\right) - i \cdot \left(c \cdot \left(a + b \cdot c\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(x \cdot y + \left(z \cdot t - c \cdot \left(i \cdot \left(a + b \cdot c\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}\;i \leq -2.6177420105736684 \cdot 10^{+24} \lor \neg \left(i \leq 3.558842578980158 \cdot 10^{+69}\right):\\
\;\;\;\;2 \cdot \left(\left(x \cdot y + z \cdot t\right) - i \cdot \left(c \cdot \left(a + b \cdot c\right)\right)\right)\\

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

\end{array}
(FPCore (x y z t a b c i)
 :precision binary64
 (* 2.0 (- (+ (* x y) (* z t)) (* (* (+ a (* b c)) c) i))))
(FPCore (x y z t a b c i)
 :precision binary64
 (if (or (<= i -2.6177420105736684e+24) (not (<= i 3.558842578980158e+69)))
   (* 2.0 (- (+ (* x y) (* z t)) (* i (* c (+ a (* b c))))))
   (* 2.0 (+ (* x y) (- (* z t) (* c (* i (+ a (* b c)))))))))
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 (((i <= -2.6177420105736684e+24) || !(i <= 3.558842578980158e+69))) {
		VAR = ((double) (2.0 * ((double) (((double) (((double) (x * y)) + ((double) (z * t)))) - ((double) (i * ((double) (c * ((double) (a + ((double) (b * c))))))))))));
	} else {
		VAR = ((double) (2.0 * ((double) (((double) (x * y)) + ((double) (((double) (z * t)) - ((double) (c * ((double) (i * ((double) (a + ((double) (b * c))))))))))))));
	}
	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.2
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 2 regimes
  2. if i < -2.6177420105736684e24 or 3.55884257898015771e69 < i

    1. Initial program 0.9

      \[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 -2.6177420105736684e24 < i < 3.55884257898015771e69

    1. Initial program 8.7

      \[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. Simplified1.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)}\]
  3. Recombined 2 regimes into one program.
  4. Final simplification1.5

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

Reproduce

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