Average Error: 5.5 → 1.3
Time: 2.2m
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}\;(\left(\left(z \cdot 18.0\right) \cdot \left(t \cdot x\right)\right) \cdot y + \left((\left(4.0 \cdot a\right) \cdot \left(-t\right) + \left(b \cdot c\right))_*\right))_* - (\left(x \cdot i\right) \cdot 4.0 + \left(\left(27.0 \cdot k\right) \cdot j\right))_* = -\infty:\\ \;\;\;\;(18.0 \cdot \left(\left(\left(y \cdot t\right) \cdot z\right) \cdot x\right) + \left(c \cdot b\right))_* - (a \cdot \left(4.0 \cdot t\right) + \left((27.0 \cdot \left(k \cdot j\right) + \left(x \cdot \left(i \cdot 4.0\right)\right))_*\right))_*\\ \mathbf{if}\;(\left(\left(z \cdot 18.0\right) \cdot \left(t \cdot x\right)\right) \cdot y + \left((\left(4.0 \cdot a\right) \cdot \left(-t\right) + \left(b \cdot c\right))_*\right))_* - (\left(x \cdot i\right) \cdot 4.0 + \left(\left(27.0 \cdot k\right) \cdot j\right))_* \le -1.5004348223981353 \cdot 10^{+57}:\\ \;\;\;\;(\left(\left(z \cdot 18.0\right) \cdot \left(t \cdot x\right)\right) \cdot y + \left((\left(4.0 \cdot a\right) \cdot \left(-t\right) + \left(b \cdot c\right))_*\right))_* - (\left(x \cdot i\right) \cdot 4.0 + \left(\left(27.0 \cdot k\right) \cdot j\right))_*\\ \mathbf{if}\;(\left(\left(z \cdot 18.0\right) \cdot \left(t \cdot x\right)\right) \cdot y + \left((\left(4.0 \cdot a\right) \cdot \left(-t\right) + \left(b \cdot c\right))_*\right))_* - (\left(x \cdot i\right) \cdot 4.0 + \left(\left(27.0 \cdot k\right) \cdot j\right))_* \le 68919070385891.41:\\ \;\;\;\;\left(\left(\left(\left(\left(x \cdot 18.0\right) \cdot y\right) \cdot \left(z \cdot t\right) - \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\\ \mathbf{if}\;(\left(\left(z \cdot 18.0\right) \cdot \left(t \cdot x\right)\right) \cdot y + \left((\left(4.0 \cdot a\right) \cdot \left(-t\right) + \left(b \cdot c\right))_*\right))_* - (\left(x \cdot i\right) \cdot 4.0 + \left(\left(27.0 \cdot k\right) \cdot j\right))_* \le 3.0254884834272297 \cdot 10^{+277}:\\ \;\;\;\;(\left(\left(z \cdot 18.0\right) \cdot \left(t \cdot x\right)\right) \cdot y + \left((\left(4.0 \cdot a\right) \cdot \left(-t\right) + \left(b \cdot c\right))_*\right))_* - (\left(x \cdot i\right) \cdot 4.0 + \left(\left(27.0 \cdot k\right) \cdot j\right))_*\\ \mathbf{else}:\\ \;\;\;\;(18.0 \cdot \left(\left(\left(y \cdot t\right) \cdot z\right) \cdot x\right) + \left(c \cdot b\right))_* - (a \cdot \left(4.0 \cdot t\right) + \left((27.0 \cdot \left(k \cdot j\right) + \left(x \cdot \left(i \cdot 4.0\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

Bits error versus j

Bits error versus k

Derivation

  1. Split input into 3 regimes
  2. if (- (fma (* (* z 18.0) (* t x)) y (fma (* 4.0 a) (- t) (* b c))) (fma (* x i) 4.0 (* (* 27.0 k) j))) < -inf.0 or 3.0254884834272297e+277 < (- (fma (* (* z 18.0) (* t x)) y (fma (* 4.0 a) (- t) (* b c))) (fma (* x i) 4.0 (* (* 27.0 k) j)))

    1. Initial program 7.6

      \[\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. Taylor expanded around inf 17.7

      \[\leadsto \left(\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)} - \left(x \cdot 4.0\right) \cdot i\right) - \left(j \cdot 27.0\right) \cdot k\]
    3. Applied simplify12.8

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

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

    if -inf.0 < (- (fma (* (* z 18.0) (* t x)) y (fma (* 4.0 a) (- t) (* b c))) (fma (* x i) 4.0 (* (* 27.0 k) j))) < -1.5004348223981353e+57 or 68919070385891.41 < (- (fma (* (* z 18.0) (* t x)) y (fma (* 4.0 a) (- t) (* b c))) (fma (* x i) 4.0 (* (* 27.0 k) j))) < 3.0254884834272297e+277

    1. Initial program 6.0

      \[\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. Taylor expanded around inf 2.5

      \[\leadsto \left(\left(\left(\color{blue}{18.0 \cdot \left(z \cdot \left(y \cdot \left(t \cdot x\right)\right)\right)} - \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\]
    3. Applied simplify0.2

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

    if -1.5004348223981353e+57 < (- (fma (* (* z 18.0) (* t x)) y (fma (* 4.0 a) (- t) (* b c))) (fma (* x i) 4.0 (* (* 27.0 k) j))) < 68919070385891.41

    1. Initial program 1.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. Using strategy rm
    3. Applied associate-*l*1.8

      \[\leadsto \left(\left(\left(\color{blue}{\left(\left(x \cdot 18.0\right) \cdot y\right) \cdot \left(z \cdot t\right)} - \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\]
  3. Recombined 3 regimes into one program.

Runtime

Time bar (total: 2.2m)Debug logProfile

herbie shell --seed '#(1070991898 1055468627 4280279443 640792587 928206309 3646738750)' +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)))