Average Error: 5.4 → 4.0
Time: 23.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}\;x \le -3.3557810378865524 \cdot 10^{-16}:\\ \;\;\;\;\left(\left(b \cdot c + \left(18.0 \cdot \left(t \cdot \left(\left(z \cdot y\right) \cdot x\right)\right) - t \cdot \left(a \cdot 4.0\right)\right)\right) - \left(4.0 \cdot x\right) \cdot i\right) - k \cdot \left(j \cdot 27.0\right)\\ \mathbf{elif}\;x \le 2.6444743891038432 \cdot 10^{+87}:\\ \;\;\;\;\left(\left(b \cdot c + \left(t \cdot \left(\left(\left(18.0 \cdot x\right) \cdot y\right) \cdot z\right) - t \cdot \left(a \cdot 4.0\right)\right)\right) - \left(4.0 \cdot x\right) \cdot i\right) - \left(k \cdot 27.0\right) \cdot j\\ \mathbf{else}:\\ \;\;\;\;\left(-t\right) \cdot \left(a \cdot 4.0\right) + \left(b \cdot c - \left(\left(j \cdot k\right) \cdot 27.0 + \left(4.0 \cdot x\right) \cdot i\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

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Split input into 3 regimes
  2. if x < -3.3557810378865524e-16

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

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

      \[\leadsto \left(\left(\left(\color{blue}{18.0 \cdot \left(t \cdot \left(x \cdot \left(z \cdot y\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\]

    if -3.3557810378865524e-16 < x < 2.6444743891038432e+87

    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(\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) - \color{blue}{j \cdot \left(27.0 \cdot k\right)}\]

    if 2.6444743891038432e+87 < x

    1. Initial program 16.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. Initial simplification8.9

      \[\leadsto \left(c \cdot b - \left(27.0 \cdot \left(k \cdot j\right) + \left(x \cdot 4.0\right) \cdot i\right)\right) + \left(\left(x \cdot 18.0\right) \cdot \left(y \cdot z\right) - a \cdot 4.0\right) \cdot t\]
    3. Taylor expanded around 0 13.6

      \[\leadsto \left(c \cdot b - \left(27.0 \cdot \left(k \cdot j\right) + \left(x \cdot 4.0\right) \cdot i\right)\right) + \left(\color{blue}{0} - a \cdot 4.0\right) \cdot t\]
  3. Recombined 3 regimes into one program.
  4. Final simplification4.0

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \le -3.3557810378865524 \cdot 10^{-16}:\\ \;\;\;\;\left(\left(b \cdot c + \left(18.0 \cdot \left(t \cdot \left(\left(z \cdot y\right) \cdot x\right)\right) - t \cdot \left(a \cdot 4.0\right)\right)\right) - \left(4.0 \cdot x\right) \cdot i\right) - k \cdot \left(j \cdot 27.0\right)\\ \mathbf{elif}\;x \le 2.6444743891038432 \cdot 10^{+87}:\\ \;\;\;\;\left(\left(b \cdot c + \left(t \cdot \left(\left(\left(18.0 \cdot x\right) \cdot y\right) \cdot z\right) - t \cdot \left(a \cdot 4.0\right)\right)\right) - \left(4.0 \cdot x\right) \cdot i\right) - \left(k \cdot 27.0\right) \cdot j\\ \mathbf{else}:\\ \;\;\;\;\left(-t\right) \cdot \left(a \cdot 4.0\right) + \left(b \cdot c - \left(\left(j \cdot k\right) \cdot 27.0 + \left(4.0 \cdot x\right) \cdot i\right)\right)\\ \end{array}\]

Reproduce

herbie shell --seed 2018362 
(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: 14.1s)Debug log

start216.0ms

Algorithm
intervals

setup211.0ms

Pruning

2 alts after pruning (2 fresh and 0 done)

Merged error: 1.9b

localize93.0ms

Local error

Found 4 expressions with local error:

6.2b
(* (* (* x 18.0) y) z)
5.1b
(* (* (* (* x 18.0) y) z) t)
0.5b
(* (* j 27.0) k)
0.2b
(* (* x 18.0) y)

rewrite33.0ms

Algorithm
rewrite-expression-head
Counts
4 → 36
Calls

4 calls. Slowest were:

12.0ms
(* (* (* (* x 18.0) y) z) t)
10.0ms
(* (* x 18.0) y)
9.0ms
(* (* (* x 18.0) y) z)

series79.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

30.0ms
(* (* (* (* x 18.0) y) z) t)
19.0ms
(* (* (* x 18.0) y) z)
18.0ms
(* (* x 18.0) y)
11.0ms
(* (* j 27.0) k)

simplify532.0ms

Counts
14 → 48
Calls

14 calls. Slowest were:

220.0ms
(* 18.0 (* t (* x (* z y))))
144.0ms
(* 18.0 (* t (* x (* z y))))
47.0ms
(* 18.0 (* x (* z y)))

prune1.5s

Pruning

6 alts after pruning (6 fresh and 0 done)

Merged error: 0.5b

localize9.0ms

Local error

Found 4 expressions with local error:

6.2b
(* (* (* x 18.0) y) z)
5.1b
(* (* (* (* x 18.0) y) z) t)
0.4b
(* j (* 27.0 k))
0.2b
(* (* x 18.0) y)

rewrite28.0ms

Algorithm
rewrite-expression-head
Counts
4 → 36
Calls

4 calls. Slowest were:

16.0ms
(* (* (* (* x 18.0) y) z) t)
6.0ms
(* (* (* x 18.0) y) z)
4.0ms
(* (* x 18.0) y)

series99.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

46.0ms
(* (* (* (* x 18.0) y) z) t)
30.0ms
(* (* (* x 18.0) y) z)
12.0ms
(* j (* 27.0 k))
11.0ms
(* (* x 18.0) y)

simplify600.0ms

Counts
14 → 48
Calls

14 calls. Slowest were:

262.0ms
(* 18.0 (* t (* x (* z y))))
217.0ms
(* 18.0 (* t (* x (* z y))))
30.0ms
(* 18.0 (* x (* z y)))

prune1.2s

Pruning

7 alts after pruning (6 fresh and 1 done)

Merged error: 0.5b

localize30.0ms

Local error

Found 4 expressions with local error:

6.2b
(* (* x (* 18.0 y)) z)
5.1b
(* (* (* x (* 18.0 y)) z) t)
0.5b
(* (* j 27.0) k)
0.2b
(* x (* 18.0 y))

rewrite13.0ms

Algorithm
rewrite-expression-head
Counts
4 → 36
Calls

4 calls. Slowest were:

7.0ms
(* (* (* x (* 18.0 y)) z) t)
3.0ms
(* (* x (* 18.0 y)) z)
2.0ms
(* (* j 27.0) k)

series86.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

35.0ms
(* (* (* x (* 18.0 y)) z) t)
22.0ms
(* (* x (* 18.0 y)) z)
17.0ms
(* (* j 27.0) k)
12.0ms
(* x (* 18.0 y))

simplify538.0ms

Counts
13 → 48
Calls

13 calls. Slowest were:

234.0ms
(* 18.0 (* t (* x (* z y))))
197.0ms
(* 18.0 (* t (* x (* z y))))
34.0ms
(* 18.0 (* x (* z y)))

prune1.0s

Pruning

7 alts after pruning (6 fresh and 1 done)

Merged error: 0.5b

localize42.0ms

Local error

Found 4 expressions with local error:

5.4b
(* (* x 18.0) (* y z))
2.0b
(* (- (* (* x 18.0) (* y z)) (* a 4.0)) t)
0.3b
(* 27.0 (* k j))
0.0b
(+ (* 27.0 (* k j)) (* (* x 4.0) i))

rewrite18.0ms

Algorithm
rewrite-expression-head
Counts
4 → 46
Calls

4 calls. Slowest were:

10.0ms
(* (- (* (* x 18.0) (* y z)) (* a 4.0)) t)
3.0ms
(* (* x 18.0) (* y z))
3.0ms
(+ (* 27.0 (* k j)) (* (* x 4.0) i))

series168.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

89.0ms
(* (- (* (* x 18.0) (* y z)) (* a 4.0)) t)
39.0ms
(+ (* 27.0 (* k j)) (* (* x 4.0) i))
25.0ms
(* (* x 18.0) (* y z))
15.0ms
(* 27.0 (* k j))

simplify2.2s

Counts
20 → 58
Calls

20 calls. Slowest were:

674.0ms
(* (* (* (* x 18.0) (* x 18.0)) (* x 18.0)) (* (* (* y z) (* y z)) (* y z)))
461.0ms
(* (- (* (* (* x 18.0) (* y z)) (* (* x 18.0) (* y z))) (* (* a 4.0) (* a 4.0))) t)
331.0ms
(- (* 18.0 (* t (* x (* z y)))) (* 4.0 (* t a)))

prune1.7s

Pruning

7 alts after pruning (5 fresh and 2 done)

Merged error: 0.5b

regimes2.8s

Accuracy

28.6% (3.3b remaining)

Error of 4.0b against oracle of 0.7b and baseline of 5.3b

bsearch867.0ms