Average Error: 5.5 → 1.2
Time: 42.3s
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 9.87007768282815 \cdot 10^{+307}:\\ \;\;\;\;\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(t \cdot x\right) \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))_*\\ \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.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. Simplified40.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 39.4

      \[\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. Simplified7.0

      \[\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*13.6

      \[\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)) < 9.87007768282815e+307

    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 9.87007768282815e+307 < (- (- (+ (- (* (* (* (* x 18.0) y) z) t) (* (* a 4.0) t)) (* b c)) (* (* x 4.0) i)) (* (* j 27.0) k))

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

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

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

      \[\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*7.0

      \[\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))_*\]
  3. Recombined 3 regimes into one program.
  4. Final simplification1.2

    \[\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 9.87007768282815 \cdot 10^{+307}:\\ \;\;\;\;\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(t \cdot x\right) \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))_*\\ \end{array}\]

Reproduce

herbie shell --seed 2019008 +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: 40.9s)Debug log

sample292.0ms

Algorithm
intervals

simplify154.0ms

Counts
1 → 1
Calls

1 calls. Slowest were:

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

prune58.0ms

Pruning

2 alts after pruning (2 fresh and 0 done)

Merged error: 3.6b

localize73.0ms

Local error

Found 4 expressions with local error:

4.0b
(* (* y z) (* x 18.0))
3.6b
(fma t (* (* y z) (* x 18.0)) (fma (* a 4.0) (- t) (* c b)))
0.1b
(fma j (* k 27.0) (* (* x 4.0) i))
0.0b
(- (fma t (* (* y z) (* x 18.0)) (fma (* a 4.0) (- t) (* c b))) (fma j (* k 27.0) (* (* x 4.0) i)))

rewrite15.0ms

Algorithm
rewrite-expression-head
Counts
4 → 65
Calls

4 calls. Slowest were:

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

series3.5s

Counts
4 → 12
Calls

4 calls. Slowest were:

3.3s
(- (fma t (* (* y z) (* x 18.0)) (fma (* a 4.0) (- t) (* c b))) (fma j (* k 27.0) (* (* x 4.0) i)))
162.0ms
(fma t (* (* y z) (* x 18.0)) (fma (* a 4.0) (- t) (* c b)))
47.0ms
(fma j (* k 27.0) (* (* x 4.0) i))
29.0ms
(* (* y z) (* x 18.0))

simplify8.6s

Counts
41 → 77
Calls

41 calls. Slowest were:

576.0ms
(* (* (* (* y z) (* y z)) (* y z)) (* (* (* x 18.0) (* x 18.0)) (* x 18.0)))
570.0ms
(+ (sqrt (fma t (* (* y z) (* x 18.0)) (fma (* a 4.0) (- t) (* c b)))) (sqrt (fma j (* k 27.0) (* (* x 4.0) i))))
519.0ms
(fma (- (fma j (* k 27.0) (* (* x 4.0) i))) 1 (* (fma j (* k 27.0) (* (* x 4.0) i)) 1))

prune2.0s

Pruning

8 alts after pruning (8 fresh and 0 done)

Merged error: 0.0b

localize20.0ms

Local error

Found 4 expressions with local error:

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

rewrite8.0ms

Algorithm
rewrite-expression-head
Counts
4 → 65
Calls

4 calls. Slowest were:

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

series3.4s

Counts
4 → 12
Calls

4 calls. Slowest were:

3.2s
(- (fma y (* (* z 18.0) (* x t)) (fma (* a 4.0) (- t) (* b c))) (fma j (* k 27.0) (* (* x 4.0) i)))
172.0ms
(fma y (* (* z 18.0) (* x t)) (fma (* a 4.0) (- t) (* b c)))
52.0ms
(fma j (* k 27.0) (* (* x 4.0) i))
32.0ms
(* (* z 18.0) (* x t))

simplify9.1s

Counts
41 → 77
Calls

41 calls. Slowest were:

636.0ms
(fma (- (fma j (* k 27.0) (* (* x 4.0) i))) 1 (* (fma j (* k 27.0) (* (* x 4.0) i)) 1))
597.0ms
(* (* (* (* z 18.0) (* z 18.0)) (* z 18.0)) (* (* (* x t) (* x t)) (* x t)))
551.0ms
(fma (- (fma j (* k 27.0) (* (* x 4.0) i))) 1 (* (fma j (* k 27.0) (* (* x 4.0) i)) 1))

prune1.8s

Pruning

8 alts after pruning (8 fresh and 0 done)

Merged error: 0.0b

localize27.0ms

Local error

Found 4 expressions with local error:

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

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)))

series229.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

148.0ms
(fma y (* z (* 18.0 (* x t))) (fma (* a 4.0) (- t) (* b c)))
33.0ms
(fma j (* k 27.0) (* (* x 4.0) i))
31.0ms
(* z (* 18.0 (* x t)))
17.0ms
(* 18.0 (* x t))

simplify707.0ms

Counts
13 → 54
Calls

13 calls. Slowest were:

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

prune1.1s

Pruning

8 alts after pruning (7 fresh and 1 done)

Merged error: 0.0b

localize15.0ms

Local error

Found 4 expressions with local error:

3.5b
(fma y (* (* (* z 18.0) x) t) (fma (* a 4.0) (- t) (* b c)))
3.4b
(* (* (* z 18.0) x) t)
0.2b
(* (* z 18.0) x)
0.1b
(fma j (* k 27.0) (* (* x 4.0) i))

rewrite9.0ms

Algorithm
rewrite-expression-head
Counts
4 → 42
Calls

4 calls. Slowest were:

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

series213.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

148.0ms
(fma y (* (* (* z 18.0) x) t) (fma (* a 4.0) (- t) (* b c)))
36.0ms
(fma j (* k 27.0) (* (* x 4.0) i))
18.0ms
(* (* (* z 18.0) x) t)
11.0ms
(* (* z 18.0) x)

simplify664.0ms

Counts
13 → 54
Calls

13 calls. Slowest were:

271.0ms
(- (+ (* 18.0 (* t (* x (* z y)))) (* b c)) (* 4.0 (* a t)))
235.0ms
(- (+ (* 18.0 (* t (* x (* z y)))) (* b c)) (* 4.0 (* a t)))
37.0ms
(* 18.0 (* t (* x z)))

prune948.0ms

Pruning

8 alts after pruning (6 fresh and 2 done)

Merged error: 0.0b

regimes2.6s

Accuracy

75% (1.1b remaining)

Error of 1.2b against oracle of 0.1b and baseline of 4.4b

bsearch18.0ms

end0.0ms

sample5.4s

Algorithm
intervals