Average Error: 5.4 → 2.3
Time: 33.2s
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}\;t \le -2.2958835929433325 \cdot 10^{+29} \lor \neg \left(t \le 1.0854025030370755 \cdot 10^{-80}\right):\\ \;\;\;\;\left(\left(b \cdot c + \left(\left(\left(z \cdot \left(18.0 \cdot y\right)\right) \cdot x\right) \cdot t - \left(a \cdot 4.0\right) \cdot t\right)\right) - \left(4.0 \cdot x\right) \cdot i\right) - k \cdot \left(j \cdot 27.0\right)\\ \mathbf{else}:\\ \;\;\;\;(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(4.0 \cdot x\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 2 regimes
  2. if t < -2.2958835929433325e+29 or 1.0854025030370755e-80 < t

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

      \[\leadsto \left(\left(\left(\left(\color{blue}{\left(x \cdot \left(18.0 \cdot y\right)\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\]
    4. Using strategy rm
    5. Applied associate-*l*2.6

      \[\leadsto \left(\left(\left(\color{blue}{\left(x \cdot \left(\left(18.0 \cdot y\right) \cdot z\right)\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 -2.2958835929433325e+29 < t < 1.0854025030370755e-80

    1. Initial program 7.8

      \[\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. Simplified8.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 8.5

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

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

Reproduce

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

sample314.0ms

Algorithm
intervals

simplify148.0ms

Counts
1 → 1
Calls

1 calls. Slowest were:

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

prune32.0ms

Pruning

2 alts after pruning (2 fresh and 0 done)

Merged error: 3.9b

localize46.0ms

Local error

Found 4 expressions with local error:

6.8b
(* (* (* (* x 18.0) y) z) t)
4.4b
(* (* (* x 18.0) y) z)
0.2b
(* (* j 27.0) k)
0.2b
(* (* x 18.0) y)

rewrite34.0ms

Algorithm
rewrite-expression-head
Counts
4 → 44
Calls

4 calls. Slowest were:

24.0ms
(* (* (* (* x 18.0) y) z) t)
6.0ms
(* (* (* x 18.0) y) z)
2.0ms
(* (* j 27.0) k)

series81.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

38.0ms
(* (* (* (* x 18.0) y) z) t)
18.0ms
(* (* (* x 18.0) y) z)
13.0ms
(* (* x 18.0) y)
12.0ms
(* (* j 27.0) k)

simplify579.0ms

Counts
14 → 56
Calls

14 calls. Slowest were:

198.0ms
(* 18.0 (* t (* x (* z y))))
185.0ms
(* 18.0 (* t (* x (* z y))))
50.0ms
(* 18.0 (* x (* z y)))

prune1.2s

Pruning

6 alts after pruning (6 fresh and 0 done)

Merged error: 0.3b

localize45.0ms

Local error

Found 4 expressions with local error:

6.8b
(* (* (* x (* 18.0 y)) z) t)
4.4b
(* (* x (* 18.0 y)) z)
0.2b
(* (* j 27.0) k)
0.2b
(* x (* 18.0 y))

rewrite38.0ms

Algorithm
rewrite-expression-head
Counts
4 → 44
Calls

4 calls. Slowest were:

16.0ms
(* (* (* x (* 18.0 y)) z) t)
14.0ms
(* (* x (* 18.0 y)) z)
5.0ms
(* (* j 27.0) k)

series107.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

48.0ms
(* (* (* x (* 18.0 y)) z) t)
20.0ms
(* x (* 18.0 y))
19.0ms
(* (* j 27.0) k)
19.0ms
(* (* x (* 18.0 y)) z)

simplify584.0ms

Counts
13 → 56
Calls

13 calls. Slowest were:

221.0ms
(* 18.0 (* t (* x (* z y))))
210.0ms
(* 18.0 (* t (* x (* z y))))
43.0ms
(* 18.0 (* x (* z y)))

prune1.3s

Pruning

5 alts after pruning (5 fresh and 0 done)

Merged error: 0.3b

localize39.0ms

Local error

Found 4 expressions with local error:

6.8b
(* (* x (* (* 18.0 y) z)) t)
4.5b
(* x (* (* 18.0 y) z))
0.2b
(* (* j 27.0) k)
0.2b
(* (* 18.0 y) z)

rewrite25.0ms

Algorithm
rewrite-expression-head
Counts
4 → 44
Calls

4 calls. Slowest were:

13.0ms
(* (* x (* (* 18.0 y) z)) t)
6.0ms
(* x (* (* 18.0 y) z))
3.0ms
(* (* j 27.0) k)

series94.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

35.0ms
(* x (* (* 18.0 y) z))
34.0ms
(* (* x (* (* 18.0 y) z)) t)
13.0ms
(* (* j 27.0) k)
11.0ms
(* (* 18.0 y) z)

simplify486.0ms

Counts
12 → 56
Calls

12 calls. Slowest were:

186.0ms
(* 18.0 (* t (* x (* z y))))
175.0ms
(* 18.0 (* t (* x (* z y))))
41.0ms
(* 18.0 (* x (* z y)))

prune1.3s

Pruning

7 alts after pruning (6 fresh and 1 done)

Merged error: 0.0b

localize41.0ms

Local error

Found 4 expressions with local error:

4.6b
(* (* y z) (* x 18.0))
3.9b
(fma t (* (* y z) (* x 18.0)) (fma (* a 4.0) (- t) (* c b)))
0.2b
(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)))

rewrite9.0ms

Algorithm
rewrite-expression-head
Counts
4 → 65
Calls

4 calls. Slowest were:

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)))
4.0ms
(* (* y z) (* x 18.0))
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)))
152.0ms
(fma t (* (* y z) (* x 18.0)) (fma (* a 4.0) (- t) (* c b)))
43.0ms
(fma j (* k 27.0) (* (* x 4.0) i))
18.0ms
(* (* y z) (* x 18.0))

simplify9.9s

Counts
41 → 77
Calls

41 calls. Slowest were:

947.0ms
(fma (- (fma j (* k 27.0) (* (* x 4.0) i))) 1 (* (fma j (* k 27.0) (* (* x 4.0) i)) 1))
650.0ms
(* (* (* (* y z) (* y z)) (* y z)) (* (* (* x 18.0) (* x 18.0)) (* x 18.0)))
582.0ms
(fma (- (fma j (* k 27.0) (* (* x 4.0) i))) 1 (* (fma j (* k 27.0) (* (* x 4.0) i)) 1))

prune1.9s

Pruning

8 alts after pruning (7 fresh and 1 done)

Merged error: 0.0b

regimes2.7s

Accuracy

50.7% (2.2b remaining)

Error of 2.3b against oracle of 0.1b and baseline of 4.5b

bsearch940.0ms

end0.0ms

sample6.1s

Algorithm
intervals