Average Error: 4.9 → 3.4
Time: 5.6m
Precision: 64
Internal Precision: 384
\[\left(\left(\left(\left(\left(\left(x \cdot 18.0\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4.0\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4.0\right) \cdot i\right) - \left(j \cdot 27.0\right) \cdot k\]
\[\begin{array}{l} \mathbf{if}\;x \le -1.3529112484688672 \cdot 10^{+112}:\\ \;\;\;\;\left(b \cdot c - 4.0 \cdot \left(x \cdot i + a \cdot t\right)\right) + \left(\left(t \cdot \left(18.0 \cdot x\right)\right) \cdot \left(y \cdot z\right) - 27.0 \cdot \left(k \cdot j\right)\right)\\ \mathbf{if}\;x \le 1.0139367462808444 \cdot 10^{+32}:\\ \;\;\;\;\left(b \cdot c - 4.0 \cdot \left(x \cdot i + a \cdot t\right)\right) + \left(\left(t \cdot \left(\left(18.0 \cdot x\right) \cdot y\right)\right) \cdot z - 27.0 \cdot \left(k \cdot j\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(b \cdot c - 4.0 \cdot \left(x \cdot i + a \cdot t\right)\right) + \left(\left(t \cdot \left(18.0 \cdot x\right)\right) \cdot \left(y \cdot z\right) - 27.0 \cdot \left(k \cdot j\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

Bits error versus j

Bits error versus k

Derivation

  1. Split input into 2 regimes
  2. if x < -1.3529112484688672e+112 or 1.0139367462808444e+32 < x

    1. Initial program 12.7

      \[\left(\left(\left(\left(\left(\left(x \cdot 18.0\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4.0\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4.0\right) \cdot i\right) - \left(j \cdot 27.0\right) \cdot k\]
    2. Applied simplify7.1

      \[\leadsto \color{blue}{\left(b \cdot c - 4.0 \cdot \left(x \cdot i + a \cdot t\right)\right) + \left(t \cdot \left(\left(18.0 \cdot x\right) \cdot \left(y \cdot z\right)\right) - 27.0 \cdot \left(k \cdot j\right)\right)}\]
    3. Using strategy rm
    4. Applied associate-*r*8.2

      \[\leadsto \left(b \cdot c - 4.0 \cdot \left(x \cdot i + a \cdot t\right)\right) + \left(\color{blue}{\left(t \cdot \left(18.0 \cdot x\right)\right) \cdot \left(y \cdot z\right)} - 27.0 \cdot \left(k \cdot j\right)\right)\]

    if -1.3529112484688672e+112 < x < 1.0139367462808444e+32

    1. Initial program 2.3

      \[\left(\left(\left(\left(\left(\left(x \cdot 18.0\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4.0\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4.0\right) \cdot i\right) - \left(j \cdot 27.0\right) \cdot k\]
    2. Applied simplify5.0

      \[\leadsto \color{blue}{\left(b \cdot c - 4.0 \cdot \left(x \cdot i + a \cdot t\right)\right) + \left(t \cdot \left(\left(18.0 \cdot x\right) \cdot \left(y \cdot z\right)\right) - 27.0 \cdot \left(k \cdot j\right)\right)}\]
    3. Using strategy rm
    4. Applied associate-*r*2.2

      \[\leadsto \left(b \cdot c - 4.0 \cdot \left(x \cdot i + a \cdot t\right)\right) + \left(t \cdot \color{blue}{\left(\left(\left(18.0 \cdot x\right) \cdot y\right) \cdot z\right)} - 27.0 \cdot \left(k \cdot j\right)\right)\]
    5. Using strategy rm
    6. Applied associate-*r*1.8

      \[\leadsto \left(b \cdot c - 4.0 \cdot \left(x \cdot i + a \cdot t\right)\right) + \left(\color{blue}{\left(t \cdot \left(\left(18.0 \cdot x\right) \cdot y\right)\right) \cdot z} - 27.0 \cdot \left(k \cdot j\right)\right)\]
  3. Recombined 2 regimes into one program.
  4. Removed slow pow expressions.

Runtime

Time bar (total: 5.6m)Debug log

herbie shell --seed '#(1567391828 2030694642 2833800258 828025724 3004380912 3532991858)' +o setup:early-exit
(FPCore (x y z t a b c i j k)
  :name "Diagrams.Solve.Polynomial:cubForm  from diagrams-solve-0.1"
  (- (- (+ (- (* (* (* (* x 18.0) y) z) t) (* (* a 4.0) t)) (* b c)) (* (* x 4.0) i)) (* (* j 27.0) k)))