Average Error: 5.3 → 1.1
Time: 21.8s
Precision: 64
Internal Precision: 128
\[\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(\left(t \cdot \left(\left(\left(x \cdot 18.0\right) \cdot y\right) \cdot z\right) - \left(a \cdot 4.0\right) \cdot t\right) + c \cdot b\right) - \left(x \cdot 4.0\right) \cdot i\right) - \left(27.0 \cdot j\right) \cdot k = -\infty:\\ \;\;\;\;(y \cdot \left(t \cdot \left(x \cdot \left(z \cdot 18.0\right)\right)\right) + \left((\left(a \cdot 4.0\right) \cdot \left(-t\right) + \left(c \cdot b\right))_*\right))_* - (j \cdot \left(k \cdot 27.0\right) + \left(\left(x \cdot 4.0\right) \cdot i\right))_*\\ \mathbf{elif}\;\left(\left(\left(t \cdot \left(\left(\left(x \cdot 18.0\right) \cdot y\right) \cdot z\right) - \left(a \cdot 4.0\right) \cdot t\right) + c \cdot b\right) - \left(x \cdot 4.0\right) \cdot i\right) - \left(27.0 \cdot j\right) \cdot k \le 1.397119905517001 \cdot 10^{+294}:\\ \;\;\;\;\left(\left(\left(t \cdot \left(\left(\left(x \cdot 18.0\right) \cdot y\right) \cdot z\right) - \left(a \cdot 4.0\right) \cdot t\right) + c \cdot b\right) - \left(x \cdot 4.0\right) \cdot i\right) - \left(27.0 \cdot j\right) \cdot k\\ \mathbf{else}:\\ \;\;\;\;(y \cdot \left(z \cdot \left(\left(x \cdot 18.0\right) \cdot t\right)\right) + \left(c \cdot b - \left(a \cdot t\right) \cdot 4.0\right))_* - (j \cdot \left(k \cdot 27.0\right) + \left(\left(x \cdot 4.0\right) \cdot i\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 (- (- (+ (- (* (* (* (* x 18.0) y) z) t) (* (* a 4.0) t)) (* b c)) (* (* x 4.0) i)) (* (* j 27.0) k)) < -inf.0

    1. Initial program 60.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. Simplified38.6

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

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

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

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

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

    1. Initial program 0.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 1.397119905517001e+294 < (- (- (+ (- (* (* (* (* x 18.0) y) z) t) (* (* a 4.0) t)) (* b c)) (* (* x 4.0) i)) (* (* j 27.0) k))

    1. Initial program 37.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. Simplified24.5

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\left(\left(\left(t \cdot \left(\left(\left(x \cdot 18.0\right) \cdot y\right) \cdot z\right) - \left(a \cdot 4.0\right) \cdot t\right) + c \cdot b\right) - \left(x \cdot 4.0\right) \cdot i\right) - \left(27.0 \cdot j\right) \cdot k = -\infty:\\ \;\;\;\;(y \cdot \left(t \cdot \left(x \cdot \left(z \cdot 18.0\right)\right)\right) + \left((\left(a \cdot 4.0\right) \cdot \left(-t\right) + \left(c \cdot b\right))_*\right))_* - (j \cdot \left(k \cdot 27.0\right) + \left(\left(x \cdot 4.0\right) \cdot i\right))_*\\ \mathbf{elif}\;\left(\left(\left(t \cdot \left(\left(\left(x \cdot 18.0\right) \cdot y\right) \cdot z\right) - \left(a \cdot 4.0\right) \cdot t\right) + c \cdot b\right) - \left(x \cdot 4.0\right) \cdot i\right) - \left(27.0 \cdot j\right) \cdot k \le 1.397119905517001 \cdot 10^{+294}:\\ \;\;\;\;\left(\left(\left(t \cdot \left(\left(\left(x \cdot 18.0\right) \cdot y\right) \cdot z\right) - \left(a \cdot 4.0\right) \cdot t\right) + c \cdot b\right) - \left(x \cdot 4.0\right) \cdot i\right) - \left(27.0 \cdot j\right) \cdot k\\ \mathbf{else}:\\ \;\;\;\;(y \cdot \left(z \cdot \left(\left(x \cdot 18.0\right) \cdot t\right)\right) + \left(c \cdot b - \left(a \cdot t\right) \cdot 4.0\right))_* - (j \cdot \left(k \cdot 27.0\right) + \left(\left(x \cdot 4.0\right) \cdot i\right))_*\\ \end{array}\]

Reproduce

herbie shell --seed 2019002 +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)))

Details

Time bar (total: 20.6s)Debug log

sample224.0ms

Algorithm
intervals

simplify147.0ms

Counts
1 → 1
Calls

1 calls. Slowest were:

147.0ms
(- (- (+ (- (* (* (* (* x 18.0) y) z) t) (* (* a 4.0) t)) (* b c)) (* (* x 4.0) i)) (* (* j 27.0) k))

prune55.0ms

Pruning

2 alts after pruning (2 fresh and 0 done)

Merged error: 4.5b

localize56.0ms

Local error

Found 4 expressions with local error:

4.2b
(fma t (* (* y z) (* x 18.0)) (fma (* a 4.0) (- t) (* c b)))
3.7b
(* (* y z) (* x 18.0))
0.3b
(fma (* a 4.0) (- t) (* c b))
0.1b
(fma j (* k 27.0) (* (* x 4.0) i))

rewrite11.0ms

Algorithm
rewrite-expression-head
Counts
4 → 45
Calls

4 calls. Slowest were:

10.0ms
(* (* y z) (* x 18.0))
0.0ms
(fma t (* (* y z) (* x 18.0)) (fma (* a 4.0) (- t) (* c b)))
0.0ms
(fma (* a 4.0) (- t) (* c b))

series247.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

140.0ms
(fma t (* (* y z) (* x 18.0)) (fma (* a 4.0) (- t) (* c b)))
44.0ms
(fma (* a 4.0) (- t) (* c b))
37.0ms
(fma j (* k 27.0) (* (* x 4.0) i))
26.0ms
(* (* y z) (* x 18.0))

simplify1.6s

Counts
15 → 57
Calls

15 calls. Slowest were:

638.0ms
(* (* (* (* y z) (* y z)) (* y z)) (* (* (* x 18.0) (* x 18.0)) (* x 18.0)))
322.0ms
(- (+ (* 18.0 (* t (* x (* z y)))) (* b c)) (* 4.0 (* a t)))
281.0ms
(- (+ (* 18.0 (* t (* x (* z y)))) (* b c)) (* 4.0 (* a t)))

prune1.3s

Pruning

5 alts after pruning (5 fresh and 0 done)

Merged error: 0.3b

localize32.0ms

Local error

Found 4 expressions with local error:

3.3b
(* (* z 18.0) (* x t))
2.5b
(fma y (* (* z 18.0) (* x t)) (fma (* a 4.0) (- t) (* b c)))
0.3b
(fma (* a 4.0) (- t) (* b c))
0.1b
(fma j (* k 27.0) (* (* x 4.0) i))

rewrite8.0ms

Algorithm
rewrite-expression-head
Counts
4 → 45
Calls

4 calls. Slowest were:

7.0ms
(* (* z 18.0) (* x t))
0.0ms
(fma y (* (* z 18.0) (* x t)) (fma (* a 4.0) (- t) (* b c)))
0.0ms
(fma (* a 4.0) (- t) (* b c))

series302.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

189.0ms
(fma y (* (* z 18.0) (* x t)) (fma (* a 4.0) (- t) (* b c)))
51.0ms
(fma j (* k 27.0) (* (* x 4.0) i))
34.0ms
(fma (* a 4.0) (- t) (* b c))
28.0ms
(* (* z 18.0) (* x t))

simplify1.5s

Counts
15 → 57
Calls

15 calls. Slowest were:

725.0ms
(* (* (* (* z 18.0) (* z 18.0)) (* z 18.0)) (* (* (* x t) (* x t)) (* x t)))
273.0ms
(- (+ (* 18.0 (* t (* x (* z y)))) (* b c)) (* 4.0 (* a t)))
260.0ms
(- (+ (* 18.0 (* t (* x (* z y)))) (* b c)) (* 4.0 (* a t)))

prune1.5s

Pruning

6 alts after pruning (6 fresh and 0 done)

Merged error: 0.3b

localize25.0ms

Local error

Found 4 expressions with local error:

3.2b
(* z (* 18.0 (* x t)))
2.5b
(fma y (* z (* 18.0 (* x t))) (fma (* a 4.0) (- t) (* b c)))
0.3b
(* 18.0 (* x t))
0.3b
(fma (* a 4.0) (- t) (* b c))

rewrite8.0ms

Algorithm
rewrite-expression-head
Counts
4 → 42
Calls

4 calls. Slowest were:

5.0ms
(* z (* 18.0 (* x t)))
2.0ms
(* 18.0 (* x t))
0.0ms
(fma y (* z (* 18.0 (* x t))) (fma (* a 4.0) (- t) (* b c)))

series242.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

150.0ms
(fma y (* z (* 18.0 (* x t))) (fma (* a 4.0) (- t) (* b c)))
46.0ms
(fma (* a 4.0) (- t) (* b c))
29.0ms
(* z (* 18.0 (* x t)))
17.0ms
(* 18.0 (* x t))

simplify821.0ms

Counts
13 → 54
Calls

13 calls. Slowest were:

319.0ms
(- (+ (* 18.0 (* t (* x (* z y)))) (* b c)) (* 4.0 (* a t)))
317.0ms
(- (+ (* 18.0 (* t (* x (* z y)))) (* b c)) (* 4.0 (* a t)))
48.0ms
(* 18.0 (* t (* x z)))

prune1.3s

Pruning

7 alts after pruning (7 fresh and 0 done)

Merged error: 0.3b

localize23.0ms

Local error

Found 4 expressions with local error:

3.2b
(* z (* 18.0 (* x t)))
2.5b
(fma y (* z (* 18.0 (* x t))) (- (* b c) (* 4.0 (* t a))))
0.3b
(* 18.0 (* x t))
0.1b
(fma j (* k 27.0) (* (* x 4.0) i))

rewrite4.0ms

Algorithm
rewrite-expression-head
Counts
4 → 42
Calls

4 calls. Slowest were:

2.0ms
(* z (* 18.0 (* x t)))
1.0ms
(* 18.0 (* x t))
0.0ms
(fma y (* z (* 18.0 (* x t))) (- (* b c) (* 4.0 (* t a))))

series263.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

173.0ms
(fma y (* z (* 18.0 (* x t))) (- (* b c) (* 4.0 (* t a))))
55.0ms
(fma j (* k 27.0) (* (* x 4.0) i))
18.0ms
(* 18.0 (* x t))
18.0ms
(* z (* 18.0 (* x t)))

simplify734.0ms

Counts
13 → 54
Calls

13 calls. Slowest were:

300.0ms
(- (+ (* 18.0 (* t (* x (* z y)))) (* b c)) (* 4.0 (* a t)))
282.0ms
(- (+ (* 18.0 (* t (* x (* z y)))) (* b c)) (* 4.0 (* a t)))
32.0ms
(+ (* 27.0 (* j k)) (* 4.0 (* i x)))

prune1.3s

Pruning

6 alts after pruning (6 fresh and 0 done)

Merged error: 0.3b

regimes2.3s

Accuracy

76.7% (0.9b remaining)

Error of 1.1b against oracle of 0.2b and baseline of 3.9b

bsearch11.0ms

end0.0ms

sample6.5s

Algorithm
intervals