Average Error: 6.0 → 3.8
Time: 12.0s
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}\;c \le 2.4693420887247912 \cdot 10^{-98}:\\ \;\;\;\;\mathsf{fma}\left(2, \mathsf{fma}\left(t, z, x \cdot y\right), \left(2 \cdot \left(\left(-\mathsf{fma}\left(c, b, a\right)\right) \cdot \left(c \cdot \left(\sqrt[3]{i} \cdot \sqrt[3]{i}\right)\right)\right)\right) \cdot \sqrt[3]{i}\right)\\ \mathbf{elif}\;c \le 8.5463068787004626 \cdot 10^{134}:\\ \;\;\;\;\mathsf{fma}\left(2, \mathsf{fma}\left(t, z, x \cdot y\right), \left(-2\right) \cdot \mathsf{fma}\left(i \cdot b, {c}^{2}, a \cdot \left(i \cdot c\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(2, \mathsf{fma}\left(t, z, x \cdot y\right), 2 \cdot \left(\left(-\mathsf{fma}\left(c, b, a\right) \cdot c\right) \cdot i\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 \le 2.4693420887247912 \cdot 10^{-98}:\\
\;\;\;\;\mathsf{fma}\left(2, \mathsf{fma}\left(t, z, x \cdot y\right), \left(2 \cdot \left(\left(-\mathsf{fma}\left(c, b, a\right)\right) \cdot \left(c \cdot \left(\sqrt[3]{i} \cdot \sqrt[3]{i}\right)\right)\right)\right) \cdot \sqrt[3]{i}\right)\\

\mathbf{elif}\;c \le 8.5463068787004626 \cdot 10^{134}:\\
\;\;\;\;\mathsf{fma}\left(2, \mathsf{fma}\left(t, z, x \cdot y\right), \left(-2\right) \cdot \mathsf{fma}\left(i \cdot b, {c}^{2}, a \cdot \left(i \cdot c\right)\right)\right)\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(2, \mathsf{fma}\left(t, z, x \cdot y\right), 2 \cdot \left(\left(-\mathsf{fma}\left(c, b, a\right) \cdot c\right) \cdot i\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 <= 2.4693420887247912e-98)) {
		VAR = ((double) fma(2.0, ((double) fma(t, z, ((double) (x * y)))), ((double) (((double) (2.0 * ((double) (((double) -(((double) fma(c, b, a)))) * ((double) (c * ((double) (((double) cbrt(i)) * ((double) cbrt(i)))))))))) * ((double) cbrt(i))))));
	} else {
		double VAR_1;
		if ((c <= 8.546306878700463e+134)) {
			VAR_1 = ((double) fma(2.0, ((double) fma(t, z, ((double) (x * y)))), ((double) (((double) -(2.0)) * ((double) fma(((double) (i * b)), ((double) pow(c, 2.0)), ((double) (a * ((double) (i * c))))))))));
		} else {
			VAR_1 = ((double) fma(2.0, ((double) fma(t, z, ((double) (x * y)))), ((double) (2.0 * ((double) (((double) -(((double) (((double) fma(c, b, a)) * c)))) * i))))));
		}
		VAR = VAR_1;
	}
	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.0
Target1.8
Herbie3.8
\[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 3 regimes
  2. if c < 2.4693420887247912e-98

    1. Initial program 4.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. Simplified1.4

      \[\leadsto \color{blue}{\mathsf{fma}\left(2, \mathsf{fma}\left(x, y, z \cdot t\right), 2 \cdot \left(\left(-\mathsf{fma}\left(c, b, a\right)\right) \cdot \left(c \cdot i\right)\right)\right)}\]
    3. Taylor expanded around inf 1.4

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

      \[\leadsto \mathsf{fma}\left(2, \color{blue}{\mathsf{fma}\left(t, z, x \cdot y\right)}, 2 \cdot \left(\left(-\mathsf{fma}\left(c, b, a\right)\right) \cdot \left(c \cdot i\right)\right)\right)\]
    5. Using strategy rm
    6. Applied add-cube-cbrt1.7

      \[\leadsto \mathsf{fma}\left(2, \mathsf{fma}\left(t, z, x \cdot y\right), 2 \cdot \left(\left(-\mathsf{fma}\left(c, b, a\right)\right) \cdot \left(c \cdot \color{blue}{\left(\left(\sqrt[3]{i} \cdot \sqrt[3]{i}\right) \cdot \sqrt[3]{i}\right)}\right)\right)\right)\]
    7. Applied associate-*r*1.7

      \[\leadsto \mathsf{fma}\left(2, \mathsf{fma}\left(t, z, x \cdot y\right), 2 \cdot \left(\left(-\mathsf{fma}\left(c, b, a\right)\right) \cdot \color{blue}{\left(\left(c \cdot \left(\sqrt[3]{i} \cdot \sqrt[3]{i}\right)\right) \cdot \sqrt[3]{i}\right)}\right)\right)\]
    8. Applied associate-*r*1.9

      \[\leadsto \mathsf{fma}\left(2, \mathsf{fma}\left(t, z, x \cdot y\right), 2 \cdot \color{blue}{\left(\left(\left(-\mathsf{fma}\left(c, b, a\right)\right) \cdot \left(c \cdot \left(\sqrt[3]{i} \cdot \sqrt[3]{i}\right)\right)\right) \cdot \sqrt[3]{i}\right)}\right)\]
    9. Applied associate-*r*1.9

      \[\leadsto \mathsf{fma}\left(2, \mathsf{fma}\left(t, z, x \cdot y\right), \color{blue}{\left(2 \cdot \left(\left(-\mathsf{fma}\left(c, b, a\right)\right) \cdot \left(c \cdot \left(\sqrt[3]{i} \cdot \sqrt[3]{i}\right)\right)\right)\right) \cdot \sqrt[3]{i}}\right)\]

    if 2.4693420887247912e-98 < c < 8.546306878700463e+134

    1. Initial program 5.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. Simplified2.2

      \[\leadsto \color{blue}{\mathsf{fma}\left(2, \mathsf{fma}\left(x, y, z \cdot t\right), 2 \cdot \left(\left(-\mathsf{fma}\left(c, b, a\right)\right) \cdot \left(c \cdot i\right)\right)\right)}\]
    3. Taylor expanded around inf 2.2

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

      \[\leadsto \mathsf{fma}\left(2, \color{blue}{\mathsf{fma}\left(t, z, x \cdot y\right)}, 2 \cdot \left(\left(-\mathsf{fma}\left(c, b, a\right)\right) \cdot \left(c \cdot i\right)\right)\right)\]
    5. Using strategy rm
    6. Applied add-cube-cbrt2.6

      \[\leadsto \mathsf{fma}\left(2, \mathsf{fma}\left(t, z, x \cdot y\right), 2 \cdot \left(\left(-\mathsf{fma}\left(c, b, a\right)\right) \cdot \left(c \cdot \color{blue}{\left(\left(\sqrt[3]{i} \cdot \sqrt[3]{i}\right) \cdot \sqrt[3]{i}\right)}\right)\right)\right)\]
    7. Applied associate-*r*2.6

      \[\leadsto \mathsf{fma}\left(2, \mathsf{fma}\left(t, z, x \cdot y\right), 2 \cdot \left(\left(-\mathsf{fma}\left(c, b, a\right)\right) \cdot \color{blue}{\left(\left(c \cdot \left(\sqrt[3]{i} \cdot \sqrt[3]{i}\right)\right) \cdot \sqrt[3]{i}\right)}\right)\right)\]
    8. Applied associate-*r*2.2

      \[\leadsto \mathsf{fma}\left(2, \mathsf{fma}\left(t, z, x \cdot y\right), 2 \cdot \color{blue}{\left(\left(\left(-\mathsf{fma}\left(c, b, a\right)\right) \cdot \left(c \cdot \left(\sqrt[3]{i} \cdot \sqrt[3]{i}\right)\right)\right) \cdot \sqrt[3]{i}\right)}\right)\]
    9. Applied associate-*r*2.2

      \[\leadsto \mathsf{fma}\left(2, \mathsf{fma}\left(t, z, x \cdot y\right), \color{blue}{\left(2 \cdot \left(\left(-\mathsf{fma}\left(c, b, a\right)\right) \cdot \left(c \cdot \left(\sqrt[3]{i} \cdot \sqrt[3]{i}\right)\right)\right)\right) \cdot \sqrt[3]{i}}\right)\]
    10. Taylor expanded around inf 4.4

      \[\leadsto \mathsf{fma}\left(2, \mathsf{fma}\left(t, z, x \cdot y\right), \color{blue}{-\left(2 \cdot \left(i \cdot \left(b \cdot {c}^{2}\right)\right) + 2 \cdot \left(a \cdot \left(i \cdot c\right)\right)\right)}\right)\]
    11. Simplified2.6

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

    if 8.546306878700463e+134 < c

    1. Initial program 31.3

      \[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. Simplified4.3

      \[\leadsto \color{blue}{\mathsf{fma}\left(2, \mathsf{fma}\left(x, y, z \cdot t\right), 2 \cdot \left(\left(-\mathsf{fma}\left(c, b, a\right)\right) \cdot \left(c \cdot i\right)\right)\right)}\]
    3. Taylor expanded around inf 4.3

      \[\leadsto \mathsf{fma}\left(2, \color{blue}{t \cdot z + x \cdot y}, 2 \cdot \left(\left(-\mathsf{fma}\left(c, b, a\right)\right) \cdot \left(c \cdot i\right)\right)\right)\]
    4. Simplified4.3

      \[\leadsto \mathsf{fma}\left(2, \color{blue}{\mathsf{fma}\left(t, z, x \cdot y\right)}, 2 \cdot \left(\left(-\mathsf{fma}\left(c, b, a\right)\right) \cdot \left(c \cdot i\right)\right)\right)\]
    5. Using strategy rm
    6. Applied associate-*r*31.3

      \[\leadsto \mathsf{fma}\left(2, \mathsf{fma}\left(t, z, x \cdot y\right), 2 \cdot \color{blue}{\left(\left(\left(-\mathsf{fma}\left(c, b, a\right)\right) \cdot c\right) \cdot i\right)}\right)\]
    7. Simplified31.3

      \[\leadsto \mathsf{fma}\left(2, \mathsf{fma}\left(t, z, x \cdot y\right), 2 \cdot \left(\color{blue}{\left(-\mathsf{fma}\left(c, b, a\right) \cdot c\right)} \cdot i\right)\right)\]
  3. Recombined 3 regimes into one program.
  4. Final simplification3.8

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \le 2.4693420887247912 \cdot 10^{-98}:\\ \;\;\;\;\mathsf{fma}\left(2, \mathsf{fma}\left(t, z, x \cdot y\right), \left(2 \cdot \left(\left(-\mathsf{fma}\left(c, b, a\right)\right) \cdot \left(c \cdot \left(\sqrt[3]{i} \cdot \sqrt[3]{i}\right)\right)\right)\right) \cdot \sqrt[3]{i}\right)\\ \mathbf{elif}\;c \le 8.5463068787004626 \cdot 10^{134}:\\ \;\;\;\;\mathsf{fma}\left(2, \mathsf{fma}\left(t, z, x \cdot y\right), \left(-2\right) \cdot \mathsf{fma}\left(i \cdot b, {c}^{2}, a \cdot \left(i \cdot c\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(2, \mathsf{fma}\left(t, z, x \cdot y\right), 2 \cdot \left(\left(-\mathsf{fma}\left(c, b, a\right) \cdot c\right) \cdot i\right)\right)\\ \end{array}\]

Reproduce

herbie shell --seed 2020114 +o rules:numerics
(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))))