Average Error: 5.9 → 1.3
Time: 1.1m
Precision: 64
Internal precision: 128
\[2.0 \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 -4.992810223583974 \cdot 10^{+25}:\\ \;\;\;\;2.0 \cdot \left(\left(y \cdot x + z \cdot t\right) - c \cdot \left(i \cdot \left(a + b \cdot c\right)\right)\right)\\ \mathbf{if}\;c \le 2.4074102642527796 \cdot 10^{+35}:\\ \;\;\;\;2.0 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right)\\ \mathbf{else}:\\ \;\;\;\;2.0 \cdot \left(\left(y \cdot x + z \cdot t\right) - c \cdot \left(i \cdot \left(a + b \cdot c\right)\right)\right)\\ \end{array}\]

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

Target

Original5.9
Comparison1.6
Herbie1.3
\[ 2.0 \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 < -4.992810223583974e+25 or 2.4074102642527796e+35 < c

    1. Initial program 21.4

      \[2.0 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right)\]
    2. Applied taylor 24.8

      \[\leadsto 2.0 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(b \cdot \left({c}^2 \cdot i\right) + a \cdot \left(c \cdot i\right)\right)\right)\]
    3. Taylor expanded around inf 24.8

      \[\leadsto 2.0 \cdot \left(\left(x \cdot y + z \cdot t\right) - \color{blue}{\left(b \cdot \left({c}^2 \cdot i\right) + a \cdot \left(c \cdot i\right)\right)}\right)\]
    4. Applied simplify 4.6

      \[\leadsto \color{blue}{2.0 \cdot \left(\left(y \cdot x + z \cdot t\right) - \left(c \cdot i\right) \cdot \left(a + b \cdot c\right)\right)}\]
    5. Using strategy rm
    6. Applied associate-*l* 3.5

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

    if -4.992810223583974e+25 < c < 2.4074102642527796e+35

    1. Initial program 0.6

      \[2.0 \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. Removed slow pow expressions

Runtime

Time bar (total: 1.1m) Debug log

Please include this information when filing a bug report:

herbie --seed '#(2247240326 1466415176 839190031 2083987511 2950843355 3951195608)'
(FPCore (x y z t a b c i)
  :name "Diagrams.ThreeD.Shapes:frustum from diagrams-lib-1.3.0.3, A"

  :target
  (* 2.0 (- (+ (* x y) (* z t)) (* (+ a (* b c)) (* c i))))

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