Average Error: 6.5 → 1.7
Time: 9.8s
Precision: 64
\[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}\;\left(\left(a + b \cdot c\right) \cdot c\right) \cdot i \le -9.88131 \cdot 10^{-324} \lor \neg \left(\left(\left(a + b \cdot c\right) \cdot c\right) \cdot i \le 1.1529310559873625 \cdot 10^{302}\right):\\ \;\;\;\;2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(a + b \cdot c\right) \cdot \left(c \cdot i\right)\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \sqrt{\left(\left(a + b \cdot c\right) \cdot c\right) \cdot i} \cdot \sqrt{\left(\left(a + b \cdot c\right) \cdot c\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}\;\left(\left(a + b \cdot c\right) \cdot c\right) \cdot i \le -9.88131 \cdot 10^{-324} \lor \neg \left(\left(\left(a + b \cdot c\right) \cdot c\right) \cdot i \le 1.1529310559873625 \cdot 10^{302}\right):\\
\;\;\;\;2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(a + b \cdot c\right) \cdot \left(c \cdot i\right)\right)\\

\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \sqrt{\left(\left(a + b \cdot c\right) \cdot c\right) \cdot i} \cdot \sqrt{\left(\left(a + b \cdot c\right) \cdot c\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 (2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i)));
}
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double temp;
	if ((((((a + (b * c)) * c) * i) <= -9.8813129168249e-324) || !((((a + (b * c)) * c) * i) <= 1.1529310559873625e+302))) {
		temp = (2.0 * (((x * y) + (z * t)) - ((a + (b * c)) * (c * i))));
	} else {
		temp = (2.0 * (((x * y) + (z * t)) - (sqrt((((a + (b * c)) * c) * i)) * sqrt((((a + (b * c)) * c) * i)))));
	}
	return temp;
}

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.5
Target1.9
Herbie1.7
\[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) i) < -9.8813129168249e-324 or 1.1529310559873625e+302 < (* (* (+ a (* b c)) c) i)

    1. Initial program 13.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. Using strategy rm
    3. Applied associate-*l*3.2

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

    if -9.8813129168249e-324 < (* (* (+ a (* b c)) c) i) < 1.1529310559873625e+302

    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)\]
    2. Using strategy rm
    3. Applied add-sqr-sqrt0.5

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\left(\left(a + b \cdot c\right) \cdot c\right) \cdot i \le -9.88131 \cdot 10^{-324} \lor \neg \left(\left(\left(a + b \cdot c\right) \cdot c\right) \cdot i \le 1.1529310559873625 \cdot 10^{302}\right):\\ \;\;\;\;2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(a + b \cdot c\right) \cdot \left(c \cdot i\right)\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \sqrt{\left(\left(a + b \cdot c\right) \cdot c\right) \cdot i} \cdot \sqrt{\left(\left(a + b \cdot c\right) \cdot c\right) \cdot i}\right)\\ \end{array}\]

Reproduce

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

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