Average Error: 5.1 → 1.2
Time: 1.6m
Precision: 64
Internal Precision: 320
\[\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}\;(\left(18.0 \cdot z\right) \cdot \left(x \cdot \left(y \cdot t\right)\right) + \left(c \cdot b\right))_* - (4.0 \cdot \left((t \cdot a + \left(i \cdot x\right))_*\right) + \left(\left(k \cdot j\right) \cdot 27.0\right))_* = -\infty \lor \neg \left((\left(18.0 \cdot z\right) \cdot \left(x \cdot \left(y \cdot t\right)\right) + \left(c \cdot b\right))_* - (4.0 \cdot \left((t \cdot a + \left(i \cdot x\right))_*\right) + \left(\left(k \cdot j\right) \cdot 27.0\right))_* \le 7.19774038001308 \cdot 10^{+300}\right):\\ \;\;\;\;\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) + c \cdot b\right) - i \cdot \left(x \cdot 4.0\right)\right) - \left(27.0 \cdot j\right) \cdot k\\ \mathbf{else}:\\ \;\;\;\;(\left(18.0 \cdot z\right) \cdot \left(x \cdot \left(y \cdot t\right)\right) + \left(c \cdot b\right))_* - (4.0 \cdot \left((t \cdot a + \left(i \cdot x\right))_*\right) + \left(\left(k \cdot j\right) \cdot 27.0\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 (- (fma (* z 18.0) (* (* y t) x) (* c b)) (fma 4.0 (fma t a (* x i)) (* (* k j) 27.0))) < -inf.0 or 7.19774038001308e+300 < (- (fma (* z 18.0) (* (* y t) x) (* c b)) (fma 4.0 (fma t a (* x i)) (* (* k j) 27.0)))

    1. Initial program 12.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\]

    if -inf.0 < (- (fma (* z 18.0) (* (* y t) x) (* c b)) (fma 4.0 (fma t a (* x i)) (* (* k j) 27.0))) < 7.19774038001308e+300

    1. Initial program 4.5

      \[\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 simplify2.1

      \[\leadsto \color{blue}{(\left(\left(t \cdot x\right) \cdot \left(y \cdot 18.0\right)\right) \cdot z + \left((\left(-a\right) \cdot \left(4.0 \cdot t\right) + \left(b \cdot c\right))_*\right))_* - (i \cdot \left(x \cdot 4.0\right) + \left(\left(27.0 \cdot k\right) \cdot j\right))_*}\]
    3. Taylor expanded around inf 2.0

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

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

    \[\leadsto \color{blue}{\begin{array}{l} \mathbf{if}\;(\left(18.0 \cdot z\right) \cdot \left(x \cdot \left(y \cdot t\right)\right) + \left(c \cdot b\right))_* - (4.0 \cdot \left((t \cdot a + \left(i \cdot x\right))_*\right) + \left(\left(k \cdot j\right) \cdot 27.0\right))_* = -\infty \lor \neg \left((\left(18.0 \cdot z\right) \cdot \left(x \cdot \left(y \cdot t\right)\right) + \left(c \cdot b\right))_* - (4.0 \cdot \left((t \cdot a + \left(i \cdot x\right))_*\right) + \left(\left(k \cdot j\right) \cdot 27.0\right))_* \le 7.19774038001308 \cdot 10^{+300}\right):\\ \;\;\;\;\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) + c \cdot b\right) - i \cdot \left(x \cdot 4.0\right)\right) - \left(27.0 \cdot j\right) \cdot k\\ \mathbf{else}:\\ \;\;\;\;(\left(18.0 \cdot z\right) \cdot \left(x \cdot \left(y \cdot t\right)\right) + \left(c \cdot b\right))_* - (4.0 \cdot \left((t \cdot a + \left(i \cdot x\right))_*\right) + \left(\left(k \cdot j\right) \cdot 27.0\right))_*\\ \end{array}}\]

Runtime

Time bar (total: 1.6m)Debug logProfile

herbie shell --seed '#(1072361757 3390613284 2339397988 1175251238 145061547 3101881848)' +o rules:numerics
(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)))