Average Error: 5.2 → 3.4
Time: 1.3m
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 -2.3980779471667324 \cdot 10^{-05}:\\ \;\;\;\;(\left(18.0 \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) \cdot t + \left(b \cdot c\right))_* - (4.0 \cdot \left((t \cdot a + \left(x \cdot i\right))_*\right) + \left(\left(27.0 \cdot k\right) \cdot j\right))_*\\ \mathbf{if}\;x \le 1.478822836078505 \cdot 10^{-37}:\\ \;\;\;\;\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\\ \mathbf{if}\;x \le +\infty:\\ \;\;\;\;(\left(18.0 \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) \cdot t + \left(b \cdot c\right))_* - (4.0 \cdot \left((t \cdot a + \left(x \cdot i\right))_*\right) + \left(\left(27.0 \cdot k\right) \cdot j\right))_*\\ \mathbf{else}:\\ \;\;\;\;(\left(18.0 \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) \cdot t + \left(b \cdot c\right))_* - (4.0 \cdot \left((t \cdot a + \left(x \cdot i\right))_*\right) + \left(\left(27.0 \cdot k\right) \cdot j\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 < -2.3980779471667324e-05 or 1.478822836078505e-37 < x

    1. Initial program 10.4

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

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

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

    if -2.3980779471667324e-05 < x < 1.478822836078505e-37

    1. Initial program 1.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\]
  3. Recombined 2 regimes into one program.

Runtime

Time bar (total: 1.3m)Debug logProfile

herbie shell --seed '#(1070131407 1246090267 3027482374 2150728003 2026520792 2347815650)' +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)))