Average Error: 6.2 → 1.4
Time: 15.4s
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)\]
\[2 \cdot \left(\left(\left(t \cdot z + x \cdot y\right) - a \cdot \left(i \cdot c\right)\right) - c \cdot \left(\left(i \cdot c\right) \cdot b\right)\right)\]
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 \cdot \left(\left(\left(t \cdot z + x \cdot y\right) - a \cdot \left(i \cdot c\right)\right) - c \cdot \left(\left(i \cdot c\right) \cdot b\right)\right)
(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
 (* 2.0 (- (- (+ (* t z) (* x y)) (* a (* i c))) (* c (* (* i c) b)))))
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) {
	return 2.0 * ((((t * z) + (x * y)) - (a * (i * c))) - (c * ((i * c) * b)));
}

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.7
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. Initial program 6.2

    \[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. Taylor expanded around 0 8.5

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

    \[\leadsto 2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \color{blue}{c \cdot \left(i \cdot \left(a + b \cdot c\right)\right)}\right)\]
  4. Using strategy rm
  5. Applied distribute-rgt-in_binary64_174195.1

    \[\leadsto 2 \cdot \left(\left(x \cdot y + z \cdot t\right) - c \cdot \color{blue}{\left(a \cdot i + \left(b \cdot c\right) \cdot i\right)}\right)\]
  6. Applied distribute-rgt-in_binary64_174195.1

    \[\leadsto 2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \color{blue}{\left(\left(a \cdot i\right) \cdot c + \left(\left(b \cdot c\right) \cdot i\right) \cdot c\right)}\right)\]
  7. Applied associate--r+_binary64_174055.1

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

    \[\leadsto 2 \cdot \left(\color{blue}{\left(\left(t \cdot z + x \cdot y\right) - a \cdot \left(i \cdot c\right)\right)} - \left(\left(b \cdot c\right) \cdot i\right) \cdot c\right)\]
  9. Using strategy rm
  10. Applied associate-*l*_binary64_174101.4

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

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

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

Reproduce

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